From 5a6fc8949596fa519e605fa252b28d709325cad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 28 Jul 2020 09:54:47 +0200 Subject: [PATCH] Fix and simplify polygon soup repairing subfunction "simplify_polygon" --- .../repair_polygon_soup.h | 40 +++++-------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h index b6df34136cb..005eb344e3d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h @@ -126,43 +126,21 @@ bool simplify_polygon(PointRange& points, { const std::size_t ini_polygon_size = polygon.size(); - // Start at the last since if two points are identical, the second one gets removed. - // By starting at 'last', we ensure that 'to_remove' is ordered from closest to .begin() - // to closest to .end() - std::size_t last = ini_polygon_size - 1, i = last; - bool stop = false; - std::vector to_remove; - - do + for(std::size_t i=0; i