make smooth an option that is OFF by default

This commit is contained in:
Sébastien Loriot 2022-12-19 14:35:16 +01:00
parent 7af87d64b6
commit f372bbe7c2
2 changed files with 6 additions and 2 deletions

View File

@ -1945,6 +1945,7 @@ remove_self_intersections_one_step(std::set<typename boost::graph_traits<Triangl
const bool treat_all_CCs,
const double strong_dihedral_angle,
const double weak_dihedral_angle,
const bool use_smoothing,
const double containment_epsilon,
const Projector& projector,
VertexPointMap vpm,
@ -2189,7 +2190,7 @@ remove_self_intersections_one_step(std::set<typename boost::graph_traits<Triangl
//
// Do not smooth if there are no self-intersections within the patch: this means the intersection
// is with another CC and smoothing is unlikely to move the surface sufficiently
if(self_intersects)
if(use_smoothing && self_intersects)
{
bool fixed_by_smoothing = false;
@ -2394,6 +2395,8 @@ bool remove_self_intersections(const FaceRange& face_range,
// detect_feature_pp NP (unused for now)
const double weak_dihedral_angle = 0.; // choose_parameter(get_parameter(np, internal_np::weak_dihedral_angle), 20.);
const double use_smoothing = choose_parameter(get_parameter(np, internal_np::use_smoothing), false);
struct Return_false
{
bool operator()(std::pair<face_descriptor, face_descriptor>) const { return false; }
@ -2492,7 +2495,7 @@ bool remove_self_intersections(const FaceRange& face_range,
internal::remove_self_intersections_one_step(
faces_to_treat, working_face_range, tmesh, step,
preserve_genus, treat_all_CCs, strong_dihedral_angle, weak_dihedral_angle,
containment_epsilon, projector, vpm, gt, visitor);
use_smoothing, containment_epsilon, projector, vpm, gt, visitor);
#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG
if(all_fixed && topology_issue)

View File

@ -144,6 +144,7 @@ CGAL_add_named_parameter(random_seed_t, random_seed, random_seed)
CGAL_add_named_parameter(do_lock_mesh_t, do_lock_mesh, do_lock_mesh)
CGAL_add_named_parameter(do_simplify_border_t, do_simplify_border, do_simplify_border)
CGAL_add_named_parameter(algorithm_t, algorithm, algorithm)
CGAL_add_named_parameter(use_smoothing_t, use_smoothing, use_smoothing)
//internal
CGAL_add_named_parameter(weight_calculator_t, weight_calculator, weight_calculator)