diff --git a/Lab/demo/Lab/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp b/Lab/demo/Lab/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp index 11a8fe9a7b3..23b2b28d48d 100644 --- a/Lab/demo/Lab/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp +++ b/Lab/demo/Lab/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp @@ -7,19 +7,23 @@ #include // must be included before kernel #include #include -#include -#include -#include -#include -#include + #include #include +#include +#include +#include +#include +#include +#include + #include #include #include +#include #include "Kernel_type.h" #include "SMesh_type.h" @@ -179,10 +183,11 @@ SMesh* poisson_reconstruct(Point_set& points, // Poisson implicit function typedef CGAL::Poisson_reconstruction_function Poisson_reconstruction_function; - // Surface mesher - typedef CGAL::Surface_mesh_default_triangulation_3 STr; - typedef CGAL::Surface_mesh_complex_2_in_triangulation_3 C2t3; - typedef CGAL::Implicit_surface_3 Surface_3; + // Mesh_3 + typedef CGAL::Labeled_mesh_domain_3 Mesh_domain; + typedef typename CGAL::Mesh_triangulation_3::type Tr; + typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; + typedef CGAL::Mesh_criteria_3 Mesh_criteria; // AABB tree typedef CGAL::AABB_face_graph_triangle_primitive Primitive; @@ -273,7 +278,7 @@ SMesh* poisson_reconstruct(Point_set& points, else { //*************************************** - // Surface mesh generation + // Surface mesh generation using Mesh_3 //*************************************** std::cerr << "Surface meshing...\n"; @@ -301,45 +306,43 @@ SMesh* poisson_reconstruct(Point_set& points, // conservative bounding sphere centered at inner point. Kernel::FT sm_sphere_radius = 5.0 * radius; Kernel::FT sm_dichotomy_error = sm_distance*average_spacing/1000.0; // Dichotomy error must be << sm_distance - Surface_3 surface(function, - Kernel::Sphere_3(inner_point,sm_sphere_radius*sm_sphere_radius), - sm_dichotomy_error/sm_sphere_radius); // Defines surface mesh generation criteria - CGAL::Surface_mesh_default_criteria_3 criteria(sm_angle, // Min triangle angle (degrees) - sm_radius*average_spacing, // Max triangle size - sm_distance*average_spacing); // Approximation error + Mesh_criteria criteria(CGAL::parameters::facet_angle = sm_angle, + CGAL::parameters::facet_size = sm_radius*average_spacing, + CGAL::parameters::facet_distance = sm_distance*average_spacing); - CGAL_TRACE_STREAM << " make_surface_mesh(sphere center=("<(domain, criteria, + CGAL::parameters::no_exude().no_perturb() + .manifold_with_boundary()); // Prints status std::cerr << "Surface meshing: " << task_timer.time() << " seconds, " - << tr.number_of_vertices() << " output vertices" + << c3t3.triangulation().number_of_vertices() << " output vertices" << std::endl; task_timer.reset(); - if(tr.number_of_vertices() == 0) + if(c3t3.triangulation().number_of_vertices() == 0) { delete mesh; return nullptr; } // Converts to polyhedron - CGAL::facets_in_complex_2_to_triangle_mesh(c2t3, *mesh); + CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, *mesh); // Prints total reconstruction duration std::cerr << "Total reconstruction (implicit function + meshing): " << reconstruction_timer.time() << " seconds\n";