From 29fbae2d2fdca6da9fd84fb72be46f89eee667e1 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 17 Feb 2026 17:40:55 +0100 Subject: [PATCH] fix the number and sizes of protecting balls --- Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h | 6 ++++-- Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h | 6 ++++++ Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 9e15289d89b..c850b2d4de1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -1468,11 +1468,11 @@ refine_balls() restart = false; boost::unordered_map new_sizes; - for(const Edge& e : c3t3_.edges_in_complex()) + for(const Edge& e : tr.finite_edges()) { if(forced_stop()) break; const auto& [va, vb] = tr.vertices(e); - const bool is_edge_in_complex = true; + const bool is_edge_in_complex = c3t3_.is_in_complex(va,vb); if( // topology condition non_adjacent_but_intersect(va, vb, is_edge_in_complex) @@ -2135,6 +2135,7 @@ repopulate(InputIterator begin, InputIterator last, // Remove last edge c3t3_.remove_from_complex(*previous, *current); + auto cp = c3t3_.triangulation().geom_traits().construct_point_3_object(); // Remove vertices (don't remove the first one and the last one) current = begin; while ( ++current != last ) @@ -2156,6 +2157,7 @@ repopulate(InputIterator begin, InputIterator last, } std::cerr << CGAL::IO::oformat(c3t3_.index(*current)) << std::endl; #endif // CGAL_MESH_3_PROTECTION_DEBUG + domain_.remove_polyline_iterator(cp(c3t3_.triangulation().point(*current)), index); *out++ = *current; c3t3_.triangulation().remove(*current); if(forced_stop()) return out; diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index fd38e349422..cba886dec58 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -628,6 +628,12 @@ public: vertex_to_polyline_iterator_[pc] = it; } + auto remove_polyline_iterator(const Point_3& p, const Curve_index& index) const + { + Point_on_curve pc{p, index}; + return vertex_to_polyline_iterator_.erase(pc); + } + void dump_curve(const Curve_index& index, const std::string& prefix) const { std::string filename(prefix); diff --git a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp index 812e49ec0c9..8dd7e0cbcb3 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp @@ -35,7 +35,7 @@ int main(int argc, char** argv) { if(argc != 2) { std::cerr << "This test needs a filename as argument.\n"; - return 0; + return 1; } typedef K::Point_3 Point;