From de1369d8ec00fa6e5de275abb12746feff2cb217 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 21 Feb 2023 10:24:25 +0100 Subject: [PATCH] improve initialization when features are inserted when the c3t3 contains no cells after initialization by features, it may be needed to add more points for initialization, even when the nb of facets in complex is > 0 It is the case for example when facets cover a very small part, or too few connected components of the domain --- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 13 +++++++++++++ Mesh_3/include/CGAL/make_mesh_3.h | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 85683e9fbd6..80d533b9c93 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -792,6 +792,7 @@ public: Moving_vertices_set& moving_vertices); void update_restricted_facets(); + void update_restricted_cells(); #ifdef CGAL_INTRUSIVE_LIST template @@ -2925,6 +2926,18 @@ update_restricted_facets() updater(*fit); } +template +void +C3T3_helpers:: +update_restricted_cells() +{ + Update_c3t3 updater(domain_, c3t3_); + for (typename C3T3::Triangulation::Finite_cells_iterator + cit = tr_.finite_cells_begin(); + cit != tr_.finite_cells_end(); ++cit) + updater(cit); +} + template template diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index a75e120da69..e6166bd41a3 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -326,6 +326,13 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_true > if (c3t3.number_of_facets() == 0) { need_more_init = true; } + else + { + helper.update_restricted_cells(); + if(c3t3.number_of_cells() == 0) { + need_more_init = true; + } + } } if(need_more_init) { init_c3t3(c3t3, domain, criteria,