|
|
@ -7,8 +7,8 @@ static inline void find_extremal_edges( |
|
|
|
const scene_bg_mesh_info_t &scene_bg_mesh_info, |
|
|
|
const stl_vector_mp<iso_vertex_t> &iso_verts, |
|
|
|
const stl_vector_mp<polygon_face_t> &iso_faces, |
|
|
|
const flat_index_group &patches, |
|
|
|
const flat_index_group &components, |
|
|
|
const flat_index_group &patches, |
|
|
|
const flat_index_group &components, |
|
|
|
const stl_vector_mp<uint32_t> &component_of_patch, |
|
|
|
const flat_hash_map_mp<compact_bg_mesh_coord_t, compact_bg_mesh_coord_t> &next_vert, |
|
|
|
// extremal edge of component i is stored at position [2*i], [2*i+1]
|
|
|
@ -26,17 +26,17 @@ static inline void find_extremal_edges( |
|
|
|
iso_vId_compId_of_tet_vert.reserve(iso_faces.size() / 2); |
|
|
|
//
|
|
|
|
stl_vector_mp<bool> is_iso_vert_visited(iso_verts.size(), false); |
|
|
|
patches.group_foreach([&](uint32_t patch_index, uint32_t range_start, uint32_t range_end) { |
|
|
|
for (auto patch_index : patches.group_indices()) { |
|
|
|
uint32_t component_id = component_of_patch[patch_index]; |
|
|
|
auto &u1 = extremal_edge_of_component[2 * component_id]; |
|
|
|
auto &u2 = extremal_edge_of_component[2 * component_id + 1]; |
|
|
|
for (uint32_t i = range_start; i < range_end; ++i) { |
|
|
|
const auto &fId = patches.index_group[i]; |
|
|
|
for (const auto &tet_face : iso_faces[fId].headers) iso_face_id_of_tet_face.try_emplace(tet_face, fId); |
|
|
|
for (const auto vId : iso_faces[fId].vertex_indices) { |
|
|
|
if (!is_iso_vert_visited[vId]) { |
|
|
|
is_iso_vert_visited[vId] = true; |
|
|
|
const auto &vert = iso_verts[vId]; |
|
|
|
for (auto face_index : patches.group(patch_index)) { |
|
|
|
for (const auto &tet_face : iso_faces[face_index].headers) |
|
|
|
iso_face_id_of_tet_face.try_emplace(tet_face, face_index); |
|
|
|
for (const auto vertex_index : iso_faces[face_index].vertex_indices) { |
|
|
|
if (!is_iso_vert_visited[vertex_index]) { |
|
|
|
is_iso_vert_visited[vertex_index] = true; |
|
|
|
const auto &vert = iso_verts[vertex_index]; |
|
|
|
if (vert.header.minimal_simplex_flag == 2) { // edge iso-vertex
|
|
|
|
const auto v1 = vert.simplex_vertex_indices[0]; |
|
|
|
const auto v2 = vert.simplex_vertex_indices[1]; |
|
|
@ -54,11 +54,11 @@ static inline void find_extremal_edges( |
|
|
|
} |
|
|
|
} |
|
|
|
// record an iso-vert on edge v1 -> v2
|
|
|
|
iso_vert_on_v_v_next[v1] = vId; |
|
|
|
iso_vert_on_v_v_next[v1] = vertex_index; |
|
|
|
// fill map
|
|
|
|
iso_vId_compId_of_tet_vert.try_emplace( |
|
|
|
simplified_vertex_header_t{vert.header.volume_index, vert.header.local_vertex_index}, |
|
|
|
component_header_t{vId, component_id}); |
|
|
|
component_header_t{vertex_index, component_id}); |
|
|
|
} else if (next_vert.at(v2) == v1) { // on tree edge v2 -> v1
|
|
|
|
// update extremal edge
|
|
|
|
if (u1.valid == 0) { |
|
|
@ -73,15 +73,15 @@ static inline void find_extremal_edges( |
|
|
|
} |
|
|
|
} |
|
|
|
// record an iso-vert on v2 -> v1
|
|
|
|
iso_vert_on_v_v_next[v2] = vId; |
|
|
|
iso_vert_on_v_v_next[v2] = vertex_index; |
|
|
|
// fill map
|
|
|
|
iso_vId_compId_of_tet_vert.try_emplace( |
|
|
|
simplified_vertex_header_t{vert.header.volume_index, vert.header.local_vertex_index}, |
|
|
|
component_header_t{vId, component_id}); |
|
|
|
component_header_t{vertex_index, component_id}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |