From a49312392af9cd6918b953bf38774c8dc1f690dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 May 2015 11:00:54 +0200 Subject: [PATCH 1/4] dump on std::cerr --- .../Polygon_mesh_processing/remove_degeneracies_example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp index ae5a614b303..5936a2c72b8 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) std::size_t nb = CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh); - std::cout << "There were " << nb << " degenerate faces in this mesh" << std::endl; + std::cerr << "There were " << nb << " degenerate faces in this mesh" << std::endl; return 0; } From b27f120a02e1c80cc8a340064a985100373d732d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 May 2015 12:04:10 +0200 Subject: [PATCH 2/4] bug-fix: Compare_distance_3 returns an enum not a bool --- .../include/CGAL/Polygon_mesh_processing/repair.h | 6 +++--- 1 file changed, 3 insertions(+), 3 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 a5f4d83bec3..dccc963d3d5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -604,9 +604,9 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, typename Traits::Compare_distance_3 compare_distance = traits.compare_distance_3_object(); halfedge_descriptor edge_to_flip; - if (!compare_distance(p1,p2, p1,p3)) // p1p2 > p1p3 + if (compare_distance(p1,p2, p1,p3) != CGAL::SMALLER) // p1p2 > p1p3 { - if (!compare_distance(p1,p2, p2,p3)) // p1p2 > p2p3 + if (compare_distance(p1,p2, p2,p3) != CGAL::SMALLER) // p1p2 > p2p3 // flip p1p2 edge_to_flip = next( halfedge(fd, tmesh), tmesh ); else @@ -614,7 +614,7 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, edge_to_flip = prev( halfedge(fd, tmesh), tmesh ); } else - if (!compare_distance(p1,p3, p2,p3)) // p1p3>p2p3 + if (compare_distance(p1,p3, p2,p3) != CGAL::SMALLER) // p1p3>p2p3 //flip p3p1 edge_to_flip = halfedge(fd, tmesh); else From 5cd9576ea010fdf12ab27c1c4ea85a043a10bcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 May 2015 15:38:08 +0200 Subject: [PATCH 3/4] add missing inline the function is not template and will be defined in each compilation-unit if not inlined --- .../Polygon_mesh_processing/internal/named_function_params.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h index f275a591ac4..7176ffdc4ee 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_function_params.h @@ -161,7 +161,7 @@ namespace Polygon_mesh_processing{ namespace parameters{ pmp_bgl_named_params - all_default() + inline all_default() { typedef pmp_bgl_named_params Params; return Params(); From b27eedb52ae836a5942cc176e82d747425e6d08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 14 May 2015 15:38:42 +0200 Subject: [PATCH 4/4] the PolygonMesh is not const so must be the vertex point map --- .../include/CGAL/Polygon_mesh_processing/repair.h | 6 +++--- 1 file changed, 3 insertions(+), 3 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 dccc963d3d5..6b330af8921 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -281,9 +281,9 @@ std::size_t remove_degenerate_faces(TriangleMesh& tmesh, typedef typename GT::vertex_descriptor vertex_descriptor; typedef typename GetVertexPointMap::type VertexPointMap; - VertexPointMap vpmap = choose_const_pmap(get_param(np, boost::vertex_point), - tmesh, - boost::vertex_point); + VertexPointMap vpmap = choose_pmap(get_param(np, boost::vertex_point), + tmesh, + boost::vertex_point); typedef typename GetGeomTraits::type Traits; Traits traits = choose_param(get_param(np, geom_traits), Traits());