From 3ccd3858ca11f39b5b24b313edf46378ecd03b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 9 Jul 2025 16:58:54 +0200 Subject: [PATCH] Minor CDT3+tet remesh example improvements --- ...emesh_constrained_Delaunay_triangulation_3.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Constrained_triangulation_3/examples/Constrained_triangulation_3/remesh_constrained_Delaunay_triangulation_3.cpp b/Constrained_triangulation_3/examples/Constrained_triangulation_3/remesh_constrained_Delaunay_triangulation_3.cpp index e87918ee70b..48ce6b2a194 100644 --- a/Constrained_triangulation_3/examples/Constrained_triangulation_3/remesh_constrained_Delaunay_triangulation_3.cpp +++ b/Constrained_triangulation_3/examples/Constrained_triangulation_3/remesh_constrained_Delaunay_triangulation_3.cpp @@ -42,6 +42,8 @@ using Constraints_pmap = CGAL::Boolean_property_map; int main(int argc, char* argv[]) { std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/mpi.off"); + double target_edge_length = (argc > 2) ? std::stod(argv[2]) : 1.0; + unsigned int iterations = (argc > 3) ? std::stoi(argv[3]) : 3; CGAL::Surface_mesh mesh; if(!CGAL::IO::read_polygon_mesh(filename, mesh)) @@ -62,17 +64,16 @@ int main(int argc, char* argv[]) namespace Tet_remesh = CGAL::Tetrahedral_remeshing; Tr tr = Tet_remesh::get_remeshing_triangulation(std::move(ccdt), np::edge_is_constrained_map(constraints_pmap)); - std::cout << "Number of vertices in tr: " << tr.number_of_vertices() << std::endl; + std::cout << "There are " << tr.number_of_vertices() << " vertices in the constrained triangulation" << std::endl; CGAL::tetrahedral_isotropic_remeshing(tr, - 1., // target edge length - np::number_of_iterations(3) - .edge_is_constrained_map(constraints_pmap)); + target_edge_length, + np::number_of_iterations(iterations) + .edge_is_constrained_map(constraints_pmap)); - std::cout << "Number of vertices in tr: " - << tr.number_of_vertices() << std::endl; + std::cout << "There are " << tr.number_of_vertices() << " vertices after remeshing" << std::endl; - std::ofstream ofs("tr.mesh"); + std::ofstream ofs("remeshed.mesh"); CGAL::IO::write_MEDIT(ofs, tr); return EXIT_SUCCESS;