Skip to content

Commit 2577ece

Browse files
committed
fix initialization
bug introduced CGAL#7712
1 parent ecbf98e commit 2577ece

File tree

1 file changed

+6
-1
lines changed
  • Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping

1 file changed

+6
-1
lines changed

Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ void simplify_range(HalfedgeRange& halfedge_range,
105105
typedef CGAL::dynamic_halfedge_property_t<bool> Halfedge_bool_tag;
106106
typedef typename boost::property_map<TriangleMesh, Halfedge_bool_tag>::type Range_halfedges;
107107

108-
Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, false);
108+
const bool all_hedges = (::CGAL::internal::exact_num_halfedges(tm)==halfedge_range.size());
109+
110+
Range_halfedges range_halfedges = get(Halfedge_bool_tag(), tm, all_hedges);
111+
if (!all_hedges)
112+
for(halfedge_descriptor h : halfedge_range)
113+
put(range_halfedges, h, true);
109114

110115
CGAL_postcondition_code(const std::size_t initial_n = halfedge_range.size();)
111116

0 commit comments

Comments
 (0)