move clear_cells_and_facets_from_c3t3() inside the constructor of Mesher_3

to make sure the input c3t3 is fully clean before starting refinement
This commit is contained in:
Jane Tournois 2024-03-14 16:28:46 +01:00
parent 24cbbc689f
commit 83c88da327
1 changed files with 7 additions and 7 deletions

View File

@ -404,6 +404,13 @@ Mesher_3<C3T3,MC,MD>::Mesher_3(C3T3& c3t3,
cells_mesher_.set_stop_pointer(stop_ptr);
facets_mesher_.set_stop_pointer(stop_ptr);
#endif
// First surface mesh could modify c3t3 without notifying cells_mesher
// So we have to ensure that no old cell will be left in c3t3
// Second, the c3t3 object could have been corrupted since the last call
// to `refine_mesh`, for example by inserting new vertices in the
// triangulation.
r_c3t3_.clear_cells_and_facets_from_c3t3();
}
@ -424,13 +431,6 @@ refine_mesh(std::string dump_after_refine_surface_prefix)
auto refine_volume_mesh_task_handle = __itt_string_handle_create("Mesher_3 refine volume mesh");
#endif // CGAL_MESH_3_USE_INTEL_ITT
// First surface mesh could modify c3t3 without notifying cells_mesher
// So we have to ensure that no old cell will be left in c3t3
// Second, the c3t3 object could have been corrupted since the last call
// to `refine_mesh`, for example by inserting new vertices in the
// triangulation.
r_c3t3_.clear_cells_and_facets_from_c3t3();
const Triangulation& r_tr = r_c3t3_.triangulation();
CGAL_USE(r_tr);