From 571dee6704e1292bcf34d8c17f79b1168af41b08 Mon Sep 17 00:00:00 2001 From: mckay Date: Wed, 22 Oct 2025 13:05:44 +0800 Subject: [PATCH 1/2] style: rename parameteric_plane_t to parametric_plane_t --- network_process/include/post_topo/chain_post_processing.hpp | 4 ++-- network_process/interface/process.hpp | 2 +- network_process/src/post_topo/map_chains.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network_process/include/post_topo/chain_post_processing.hpp b/network_process/include/post_topo/chain_post_processing.hpp index 5b91e72..181210a 100644 --- a/network_process/include/post_topo/chain_post_processing.hpp +++ b/network_process/include/post_topo/chain_post_processing.hpp @@ -27,5 +27,5 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& const flat_hash_map_mp>& chain_of_patch, const flat_hash_map_mp& vertex_old_index_to_unique_index, const dynamic_bitset_mp<>& chain_end_vertex_signular_flag, - flat_hash_map_mp& parameteric_planes); -void remap_parameteric_plane_vertices(flat_hash_map_mp& parameteric_planes); \ No newline at end of file + flat_hash_map_mp& parameteric_planes); +void remap_parameteric_plane_vertices(flat_hash_map_mp& parameteric_planes); \ No newline at end of file diff --git a/network_process/interface/process.hpp b/network_process/interface/process.hpp index 731e7b7..f8b130a 100644 --- a/network_process/interface/process.hpp +++ b/network_process/interface/process.hpp @@ -4,7 +4,7 @@ #include "settings.h" -struct parameteric_plane_t { +struct parametric_plane_t { /// plane associated properties Eigen::AlignedBox2d uv_bounds{}; /// chain associated properties diff --git a/network_process/src/post_topo/map_chains.cpp b/network_process/src/post_topo/map_chains.cpp index 0f4f82f..7a90e3d 100644 --- a/network_process/src/post_topo/map_chains.cpp +++ b/network_process/src/post_topo/map_chains.cpp @@ -76,7 +76,7 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& } } -void remap_parameteric_plane_vertices(flat_hash_map_mp& parameteric_planes) +void remap_parameteric_plane_vertices(flat_hash_map_mp& parameteric_planes) { for (auto& [_, parameteric_plane] : parameteric_planes) { auto& uv_bounds = parameteric_plane.uv_bounds; From d984b98d3a1348980d8d1d430e005d1eb192a810 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang <1627343141@qq.com> Date: Wed, 22 Oct 2025 15:45:27 +0800 Subject: [PATCH 2/2] fix compilation error --- .../src/connect_by_topo/patch_connectivity.cpp | 17 +++++++---------- network_process/src/post_topo/map_chains.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/network_process/src/connect_by_topo/patch_connectivity.cpp b/network_process/src/connect_by_topo/patch_connectivity.cpp index bd2e75e..35a59fc 100644 --- a/network_process/src/connect_by_topo/patch_connectivity.cpp +++ b/network_process/src/connect_by_topo/patch_connectivity.cpp @@ -82,12 +82,12 @@ void compute_patches(const stl_vector_mp>& edges_of } } -void compute_chains(const flat_hash_map_mp& patch_edges, - const flat_hash_set_mp& patch_boundary_edges, - const stl_vector_mp& iso_faces, - stl_vector_mp>& chain_vertices, - stl_vector_mp& chain_edge_headers, - stl_vector_mp& chain_headers) +void compute_chains(const flat_hash_map_mp& patch_edges, + const flat_hash_set_mp& patch_boundary_edges, + const stl_vector_mp& iso_faces, + stl_vector_mp>& chain_vertices, + stl_vector_mp& chain_edge_headers, + stl_vector_mp& chain_headers) { flat_hash_map_mp> non_manifold_edges_of_vert{}; non_manifold_edges_of_vert.reserve(patch_boundary_edges.size() / 2); @@ -117,10 +117,7 @@ void compute_chains(const flat_hash_map_mp& patch_e flat_hash_set_mp unique_volume_indices{}; new_chain_edge_headers.subface_indices.reserve(new_chain_headers.face_indices.size()); for (const auto& face_index : new_chain_headers.face_indices) { - std::transform(iso_faces[face_index].headers.begin(), - iso_faces[face_index].headers.end(), - std::back_inserter(unique_volume_indices), - [](const face_header_t& header) { return header.volume_index; }); + for (const auto& [volume_index, _] : iso_faces[face_index].headers) unique_volume_indices.emplace(volume_index); new_chain_edge_headers.subface_indices.emplace_back(iso_faces[face_index].subface_index); } std::move(unique_volume_indices.begin(), diff --git a/network_process/src/post_topo/map_chains.cpp b/network_process/src/post_topo/map_chains.cpp index 0f4f82f..2350b81 100644 --- a/network_process/src/post_topo/map_chains.cpp +++ b/network_process/src/post_topo/map_chains.cpp @@ -22,7 +22,8 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& stl_vector_mp unique_chain_indices{}; flat_hash_map_mp old_chain_index_to_unique_index{}; auto unique_end_iter = unique_chain_indices.begin(); - for (const auto& [subface_index, patch_indices] : patch_of_subface) { + for (const auto& [subface_index_, patch_indices] : patch_of_subface) { + const auto subface_index = subface_index_; const auto& subface = subfaces[subface_index].object_ptr.get(); auto mapping_func = subface.fetch_param_mapping_evaluator(); auto& parameteric_plane = parameteric_planes[subface_index]; @@ -62,7 +63,11 @@ void map_chain_to_parameteric_plane(const baked_blobtree_t& chain_vertex_flags_[0] = chain_end_vertex_signular_flag[2 * chain_index]; chain_vertex_flags_[chain.size() - 1] = chain_end_vertex_signular_flag[2 * chain_index + 1]; - chain_other_subface_indices.emplace_back(chain_edge_headers[chain_index].subface_indices); + const auto& subface_indices = chain_edge_headers[chain_index].subface_indices; + const auto other_subface_index = *std::find_if_not(subface_indices.begin(), + subface_indices.end(), + [&](uint32_t index) { return index == subface_index; }); + chain_other_subface_indices.emplace_back(other_subface_index); } for (const auto& patch_index : patch_indices) {