From 39331c3b65ea610bb6b5529e51172c6af901a08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Apr 2022 09:19:33 +0200 Subject: [PATCH] use non-deprecated function --- .../cc_compatible_orientations.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_compatible_orientations.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_compatible_orientations.cpp index 89111c88048..7b9f51a0670 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_compatible_orientations.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_compatible_orientations.cpp @@ -9,6 +9,7 @@ #include #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; @@ -33,6 +34,8 @@ int main() std::vector< std::array > triangles; triangles.reserve(faces(mesh).size()); points.reserve(3*triangles.size()); + std::random_device rd; + std::mt19937 g(rd()); for (Mesh::Face_index f : mesh.faces()) { Mesh::Halfedge_index h = mesh.halfedge(f); @@ -41,12 +44,13 @@ int main() points.push_back(mesh.point(target(h,mesh))); points.push_back(mesh.point(target(mesh.next(h),mesh))); triangles.push_back( {s, s+1, s+2} ); - std::random_shuffle(triangles.back().begin(), triangles.back().end()); + std::shuffle(triangles.back().begin(), triangles.back().end(), g); } // load the soup into the mesh; mesh.clear(); PMP::polygon_soup_to_polygon_mesh(points, triangles, mesh); + std::ofstream("soup.off") << mesh; // now check how face orientation should be reversed auto fbm = mesh.add_property_map("fbm", false).first; @@ -63,7 +67,7 @@ int main() PMP::stitch_borders(mesh); assert(CGAL::is_closed(mesh)); - std::ofstream("out.off") << mesh; + std::ofstream("reoriented_and_stitched.off") << mesh; return 0; }