mirror of https://github.com/CGAL/cgal
add parameters to isotropic_remeshing
to able/disable split, collapse, and flip
This commit is contained in:
parent
3613a94638
commit
ec7a211a1d
|
|
@ -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_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(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_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_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(do_self_intersection_tests_t, do_self_intersection_tests, do_self_intersection_tests)
|
||||||
CGAL_add_named_parameter(error_codes_t, error_codes, error_codes)
|
CGAL_add_named_parameter(error_codes_t, error_codes, error_codes)
|
||||||
|
|
|
||||||
|
|
@ -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);
|
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);
|
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);
|
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
|
#ifdef CGAL_PMP_REMESHING_VERBOSE
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
@ -293,10 +296,13 @@ void isotropic_remeshing(const FaceRange& faces
|
||||||
#endif
|
#endif
|
||||||
if (target_edge_length>0)
|
if (target_edge_length>0)
|
||||||
{
|
{
|
||||||
remesher.split_long_edges(high);
|
if(do_split)
|
||||||
remesher.collapse_short_edges(low, high, collapse_constraints);
|
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);
|
remesher.tangential_relaxation(smoothing_1d, nb_laplacian);
|
||||||
if ( choose_parameter(get_parameter(np, internal_np::do_project), true) )
|
if ( choose_parameter(get_parameter(np, internal_np::do_project), true) )
|
||||||
remesher.project_to_surface(get_parameter(np, internal_np::projection_functor));
|
remesher.project_to_surface(get_parameter(np, internal_np::projection_functor));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue