From 2577ecea2756eb9faaf99a46a4a8435ad5567ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 5 Jul 2024 13:01:45 +0200 Subject: [PATCH] fix initialization bug introduced #7712 --- .../CGAL/Polygon_mesh_processing/internal/Snapping/snap.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index 22054b8413f..62c893b7f4e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -105,7 +105,12 @@ void simplify_range(HalfedgeRange& halfedge_range, typedef CGAL::dynamic_halfedge_property_t Halfedge_bool_tag; typedef typename boost::property_map::type Range_halfedges; - Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, false); + const bool all_hedges = (::CGAL::internal::exact_num_halfedges(tm)==halfedge_range.size()); + + Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, all_hedges); + if (!all_hedges) + for(halfedge_descriptor h : halfedge_range) + put(range_halfedges, h, true); CGAL_postcondition_code(const std::size_t initial_n = halfedge_range.size();)