diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h index 5ebd27391d8..1e282df8c0b 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h @@ -1,5 +1,5 @@ // Copyright (c) 2003-2007 INRIA Sophia-Antipolis (France). -// Copyright (c) 2008,2011 GeometryFactory Sarl (France) +// Copyright (c) 2008,2011,2024 GeometryFactory Sarl (France) // All rights reserved. // // This file is part of CGAL (www.cgal.org). diff --git a/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h b/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h index d926f3d1172..e3da9e661bc 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/poisson_surface_reconstruction.h @@ -14,10 +14,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -97,9 +99,10 @@ namespace CGAL { typedef typename Kernel::FT FT; typedef CGAL::Poisson_reconstruction_function Poisson_reconstruction_function; - typedef typename CGAL::Surface_mesher::Surface_mesh_default_triangulation_3_generator::Type STr; - typedef CGAL::Surface_mesh_complex_2_in_triangulation_3 C2t3; - typedef CGAL::Implicit_surface_3 Surface_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; Poisson_reconstruction_function function(begin, end, point_map, normal_map); if ( ! function.compute_implicit_function() ) @@ -112,26 +115,34 @@ namespace CGAL { FT sm_sphere_radius = 5.0 * radius; FT sm_dichotomy_error = sm_distance * spacing / 1000.0; - Surface_3 surface(function, - Sphere (inner_point, sm_sphere_radius * sm_sphere_radius), - sm_dichotomy_error / sm_sphere_radius); + Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain(function, Sphere(inner_point, sm_sphere_radius), + CGAL::parameters::relative_error_bound(sm_dichotomy_error / sm_sphere_radius)); - CGAL::Surface_mesh_default_criteria_3 criteria (sm_angle, - sm_radius * spacing, - sm_distance * spacing); + Mesh_criteria criteria(CGAL::parameters::facet_angle = sm_angle, + CGAL::parameters::facet_size = sm_radius*spacing, + CGAL::parameters::facet_distance = sm_distance*spacing); - STr tr; - C2t3 c2t3(tr); - CGAL::make_surface_mesh(c2t3, - surface, - criteria, - tag); + auto turn_tag_into_mesh_3_manifold_option = [](Tag) { + if constexpr (std::is_same_v) + return CGAL::parameters::manifold_with_boundary(); + else if constexpr (std::is_same_v) + return CGAL::parameters::manifold(); + else + return CGAL::parameters::non_manifold(); + }; + + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, + turn_tag_into_mesh_3_manifold_option(tag) + .no_exude().no_perturb() + .manifold_with_boundary()); + + const auto& tr = c3t3.triangulation(); if(tr.number_of_vertices() == 0) return false; - CGAL::facets_in_complex_2_to_triangle_mesh(c2t3, output_mesh); + CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, output_mesh); return true; }