diff --git a/network_process/include/prim_gen.hpp b/network_process/include/prim_gen.hpp index 8901fd1..51e7b71 100644 --- a/network_process/include/prim_gen.hpp +++ b/network_process/include/prim_gen.hpp @@ -19,7 +19,7 @@ void build_tetrahedron_and_adjacency(const scene_bg_mesh_info flat_hash_map_mp>& reverse_vertex_adjacency, btree_map_mp>& vertex_to_tet_mapping); void filter_tet_by_subface(const btree_map_mp>& vertex_to_tet_mapping, - Eigen::Ref vertex_infos, + Eigen::MatrixXd& vertex_infos, flat_hash_map_mp& vertex_indices_mapping, stl_vector_mp>& tetrahedrons, flat_hash_map_mp& vertex_lexigraphical_adjacency, diff --git a/network_process/src/prim_gen/filter_tet_by_subface.cpp b/network_process/src/prim_gen/filter_tet_by_subface.cpp index b03d9cd..ff8dded 100644 --- a/network_process/src/prim_gen/filter_tet_by_subface.cpp +++ b/network_process/src/prim_gen/filter_tet_by_subface.cpp @@ -16,7 +16,7 @@ // }; void filter_tet_by_subface(const btree_map_mp>& vertex_to_tet_mapping, - Eigen::Ref vertex_infos, + Eigen::MatrixXd& vertex_infos, flat_hash_map_mp& vertex_indices_mapping, stl_vector_mp>& tetrahedrons, flat_hash_map_mp& vertex_lexigraphical_adjacency, @@ -140,6 +140,7 @@ void filter_tet_by_subface(const btree_map_mp> filtered_vertex_lexigraphical_adjacency.emplace(vertex_index, vertex_indices_mapping.at(vertex_index)); filtered_vert_infos_iter++; } + vertex_infos.resize(filtered_vert_infos.rows(), filtered_vert_infos.cols()); vertex_infos = std::move(filtered_vert_infos); vertex_lexigraphical_adjacency = std::move(filtered_vertex_lexigraphical_adjacency); } \ No newline at end of file diff --git a/network_process/src/process.cpp b/network_process/src/process.cpp index 8c9aeab..36fea8c 100644 --- a/network_process/src/process.cpp +++ b/network_process/src/process.cpp @@ -106,6 +106,10 @@ ISNP_API void build_implicit_network_by_blobtree(const s_settings& { arrangement_cells.reserve(shells.size()); for (uint32_t i = 0; i < shells.size(); ++i) { arrangement_cells.emplace_back(stl_vector_mp{i}); } + shell_to_cell.resize(shells.size()); + for (uint32_t i = 0; i < arrangement_cells.size(); i++) { + for (auto shell : arrangement_cells[i]) shell_to_cell[shell] = i; + } } else { { stl_vector_mp> shell_links{}; @@ -124,10 +128,6 @@ ISNP_API void build_implicit_network_by_blobtree(const s_settings& shell_links); compute_arrangement_cells(static_cast(shells.size()), shell_links, arrangement_cells); } - shell_to_cell.resize(shells.size()); - for (uint32_t i = 0; i < arrangement_cells.size(); i++) { - for (auto shell : arrangement_cells[i]) shell_to_cell[shell] = i; - } } // post process {