From 302a2707ea9b083993b06dd0e726780b76b2c736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 21 Mar 2022 07:11:41 +0100 Subject: [PATCH] use PMP functions (already dealing with Lazy calls) --- .../CGAL/Polygon_mesh_processing/repair.h | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 46b3dbe9ae8..569b1a1fb6b 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -241,12 +242,7 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, if(use_areas) { - for(face_descriptor f : faces(tmesh)) - { - const FT fa = face_area(f, tmesh, np); - component_areas[face_cc[f]] += fa; - total_area += fa; - } + total_area = area(tmesh); #ifdef CGAL_PMP_DEBUG_SMALL_CC_REMOVAL std::cout << "area threshold: " << area_threshold << std::endl; @@ -269,26 +265,16 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, typename GT::Compute_volume_3 cv3 = traits.compute_volume_3_object(); Point_3 origin(0, 0, 0); - for(face_descriptor f : faces(tmesh)) - { - const std::size_t i = face_cc[f]; - if(!cc_closeness[i]) - continue; - - const FT fv = cv3(origin, - get(vpm, target(halfedge(f, tmesh), tmesh)), - get(vpm, target(next(halfedge(f, tmesh), tmesh), tmesh)), - get(vpm, target(prev(halfedge(f, tmesh), tmesh), tmesh))); - - component_volumes[i] += fv; - } - - // negative volume means the CC was oriented inward FT total_volume = 0; - for(std::size_t i=0; i fcc(tmesh); + for (std::size_t i=0; i