From ec7a211a1d61aea627d11f039bae8ffc0d3b9727 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 22 Jun 2021 14:22:32 +0200 Subject: [PATCH] add parameters to isotropic_remeshing to able/disable split, collapse, and flip --- BGL/include/CGAL/boost/graph/parameters_interface.h | 3 +++ .../include/CGAL/Polygon_mesh_processing/remesh.h | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h index a1fe60c5f75..cad9f55fe03 100644 --- a/BGL/include/CGAL/boost/graph/parameters_interface.h +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -102,6 +102,9 @@ CGAL_add_named_parameter(use_angle_smoothing_t, use_angle_smoothing, use_angle_s CGAL_add_named_parameter(use_area_smoothing_t, use_area_smoothing, use_area_smoothing) CGAL_add_named_parameter(use_Delaunay_flips_t, use_Delaunay_flips, use_Delaunay_flips) CGAL_add_named_parameter(do_project_t, do_project, do_project) +CGAL_add_named_parameter(do_split_t, do_split, do_split) +CGAL_add_named_parameter(do_collapse_t, do_collapse, do_collapse) +CGAL_add_named_parameter(do_flip_t, do_flip, do_flip) CGAL_add_named_parameter(do_orientation_tests_t, do_orientation_tests, do_orientation_tests) CGAL_add_named_parameter(do_self_intersection_tests_t, do_self_intersection_tests, do_self_intersection_tests) CGAL_add_named_parameter(error_codes_t, error_codes, error_codes) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 52c7e019587..b3257693e8c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -278,6 +278,9 @@ void isotropic_remeshing(const FaceRange& faces unsigned int nb_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 1); bool smoothing_1d = choose_parameter(get_parameter(np, internal_np::relax_constraints), false); unsigned int nb_laplacian = choose_parameter(get_parameter(np, internal_np::number_of_relaxation_steps), 1); + bool do_collapse = choose_parameter(get_parameter(np, internal_np::do_collapse), true); + bool do_split = choose_parameter(get_parameter(np, internal_np::do_split), true); + bool do_flip = choose_parameter(get_parameter(np, internal_np::do_flip), true); #ifdef CGAL_PMP_REMESHING_VERBOSE std::cout << std::endl; @@ -293,10 +296,13 @@ void isotropic_remeshing(const FaceRange& faces #endif if (target_edge_length>0) { - remesher.split_long_edges(high); - remesher.collapse_short_edges(low, high, collapse_constraints); + if(do_split) + remesher.split_long_edges(high); + if(do_collapse) + remesher.collapse_short_edges(low, high, collapse_constraints); } - remesher.flip_edges_for_valence_and_shape(); + if(do_flip) + remesher.flip_edges_for_valence_and_shape(); remesher.tangential_relaxation(smoothing_1d, nb_laplacian); if ( choose_parameter(get_parameter(np, internal_np::do_project), true) ) remesher.project_to_surface(get_parameter(np, internal_np::projection_functor));