From 3501af6c616916e3f592b44248c646bd82e7396d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 13 Feb 2020 14:38:19 +0100 Subject: [PATCH] handle the case of interior vertex The vertex becomes interior after the stitch of the patch while being the endpoint of a polyline to be removed fix patch introduced in 6e31445f6207e98557905f11cde0859a3d3dd6ff --- .../internal/Corefinement/face_graph_utils.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h index 5d9759f9659..6300e2e13c4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h @@ -1640,9 +1640,22 @@ void remove_unused_polylines( halfedge_descriptor h = halfedge(v, tm), start=GT::null_halfedge(); do{ + + halfedge_descriptor tmp_start = h; while ( !is_border(h, tm) || is_border(opposite(h, tm), tm) ) + { h = opposite(next(h, tm), tm); + if (tmp_start==h) break; + } + if( !is_border(h, tm) ) + { + // nothing to do: the vertex has already been updated and is now in the middle of a patch kept. + // This function can be called after the stitching of the patches kept, the vertex halfedge + // can have been updated and no border halfedge might be found + break; + } halfedge_descriptor in = h; + if (start==GT::null_halfedge()) start=in; else