rename do_snap to apply_iterative_snap_rounding, remove trailing whitespace

This commit is contained in:
Léo Valque 2025-02-17 18:09:04 +01:00
parent ac7bf3c45f
commit 9b84d4c73c
5 changed files with 16 additions and 16 deletions

View File

@ -889,7 +889,7 @@ would then also includes overlaps of duplicated points.
The function `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` provides a way to refine a triangle soup
using the intersections of the triangles from the soup. In particular, if some points are duplicated they will be
merged. Note that if a kernel with exact predicates but inexact constructions is used, some new self-intersections
might be introduced due to rounding issues of points coordinates. The `do_snap` option can be used to resolve this issue.
might be introduced due to rounding issues of points coordinates. The `apply_iterative_snap_rounding` option can be used to resolve this issue.
When set to `true`, it ensures the coordinates are rounded to fit in `double` with potential additional subdivisions,
preventing any self-intersections from occurring.
@ -1441,7 +1441,7 @@ used as a reference during the project.
The curvature-based sizing field version of isotropic remeshing was added by Ivan Pađen during GSoC 2023, under the supervision of Sébastien Loriot and Jane Tournois.
The `do_snap` option for autorefinement were implemented during 2025. This was implemented by Léo Valque and Sylvain Lazard. The implementation is based on \cgalCite{lazard:hal-04907149}.
The `apply_iterative_snap_rounding` option for autorefinement were implemented during 2025. This was implemented by Léo Valque and Sylvain Lazard. The implementation is based on \cgalCite{lazard:hal-04907149}.
*/
} /* namespace CGAL */

View File

@ -1,5 +1,5 @@
#define PMP_ROUNDING_VERTICES_IN_POLYGON_SOUP_VERBOSE
#define CGAL_PMP_AUTOREFINE_USE_DEFAULT_VERBOSE
// #define CGAL_PMP_AUTOREFINE_USE_DEFAULT_VERBOSE
#include <CGAL/Cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
@ -41,7 +41,7 @@ int main(int argc, char** argv)
CGAL::Real_timer t;
t.start();
PMP::autorefine_triangle_soup(input_points, input_triangles, CGAL::parameters::do_snap(true).erase_all_duplicates(true).concurrency_tag(CGAL::Parallel_if_available_tag()).snap_grid_size(grid_size));
PMP::autorefine_triangle_soup(input_points, input_triangles, CGAL::parameters::apply_iterative_snap_rounding(true).erase_all_duplicates(true).concurrency_tag(CGAL::Parallel_if_available_tag()).snap_grid_size(grid_size));
t.stop();
std::cout << "#points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " in " << t.time() << " sec." << std::endl;

View File

@ -994,7 +994,7 @@ bool snap_polygon_soup(PointRange &points,
* `soup_triangles` will be updated to contain both the input triangles and the new subdivided triangles. Degenerate triangles will be removed.
* Also triangles in `soup_triangles` will be triangles without intersection first, followed by triangles coming from a subdivision induced
* by an intersection. The named parameter `visitor()` can be used to track
* If the do_snap parameter is set to true, the coordinates of the vertices are rounded to fit within the precision of a double-precision floating point,
* If the `apply_iterative_snap_rounding` parameter is set to true, the coordinates of the vertices are rounded to fit within the precision of a double-precision floating point,
* while preserving the model free of intersections. Note that this option does not guarantee an intersection-free output; however,
* the returned boolean will be true if the output is free of self-intersections. The snap_grid_size parameter limits the drift of the snapped vertices.
* A smaller value is more likely to output an intersection free output and perform more vertex collapses, but it may increase the Hausdorff distance from the input.
@ -1033,19 +1033,19 @@ bool snap_polygon_soup(PointRange &points,
* \cgalParamDefault{`Autorefinement::Default_visitor`}
* \cgalParamExtra{The visitor will be copied.}
* \cgalParamNEnd
* \cgalParamNBegin{do_snap}
* \cgalParamNBegin{apply_iterative_snap_rounding}
* \cgalParamDescription{Enable the rounding of the coordinates so that they fit in doubles.}
* \cgalParamType{boolean}
* \cgalParamDefault{false}
* \cgalParamNEnd
* \cgalParamNBegin{snap_grid_size}
* \cgalParamDescription{Scale the points to [-2^gs, 2^gs] where gs is the snap_grid_size before to round them on integer. Use only if do_snap is true.}
* \cgalParamDescription{Scale the points to [-2^gs, 2^gs] where gs is the snap_grid_size before to round them on integer. Use only if `apply_iterative_snap_rounding` is true.}
* \cgalParamType{unsigned int}
* \cgalParamDefault{23}
* \cgalParamExtra{Must be lower than 52.}
* \cgalParamNEnd
* \cgalParamNBegin{numbers_of_iteration}
* \cgalParamDescription{Maximum number of iteration performed by the snap algorithm. Use only if do_snap is true.}
* \cgalParamDescription{Maximum number of iteration performed by the snap algorithm. Use only if `apply_iterative_snap_rounding` is true.}
* \cgalParamType{unsigned int}
* \cgalParamDefault{15}
* \cgalParamNEnd
@ -1081,8 +1081,8 @@ bool autorefine_triangle_soup(PointRange& soup_points,
> ::type Visitor;
Visitor visitor(choose_parameter<Visitor>(get_parameter(np, internal_np::visitor)));
//TODO just modify do_snap instead of getting np one by one
const bool do_snap = choose_parameter(get_parameter(np, internal_np::do_snap), false);
//TODO just modify apply_iterative_snap_rounding instead of getting np one by one
const bool do_snap = choose_parameter(get_parameter(np, internal_np::apply_iterative_snap_rounding), false);
const int grid_size = choose_parameter(get_parameter(np, internal_np::snap_grid_size), 23);
const unsigned int nb_of_iteration = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 15);
const bool ead = choose_parameter(get_parameter(np, internal_np::erase_all_duplicates), false);

View File

@ -220,7 +220,7 @@ CGAL_add_named_parameter(scan_angle_t, scan_angle_map, scan_angle_map)
CGAL_add_named_parameter(scanline_id_t, scanline_id_map, scanline_id_map)
CGAL_add_named_parameter(min_points_per_cell_t, min_points_per_cell, min_points_per_cell)
CGAL_add_named_parameter(scalar_t, scalar_map, scalar_map)
CGAL_add_named_parameter(do_snap_t, do_snap, do_snap)
CGAL_add_named_parameter(apply_iterative_snap_rounding_t, apply_iterative_snap_rounding, apply_iterative_snap_rounding)
CGAL_add_named_parameter(snap_grid_size_t, snap_grid_size, snap_grid_size)
// List of named parameters used in Surface_mesh_approximation package