From ac7bf3c45f3a8e52871bfd86a4893e6d361fc7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valque?= Date: Mon, 17 Feb 2025 15:44:10 +0100 Subject: [PATCH] Doc modification of autorefine and Polygon mesh processing --- Documentation/doc/biblio/geom.bib | 13 +++++++++++++ .../Polygon_mesh_processing.txt | 10 +++++++--- .../Polygon_mesh_processing/snap_polygon_soup.cpp | 2 -- .../CGAL/Polygon_mesh_processing/autorefinement.h | 4 +++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index 270267703f8..b71da6e6bdf 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -152085,3 +152085,16 @@ keywords = {polygonal surface mesh, Surface reconstruction, kinetic framework, s year={2014}, publisher={Elsevier} } + +@unpublished{lazard:hal-04907149, + TITLE = {{Removing self-intersections in 3D meshes while preserving floating-point coordinates}}, + AUTHOR = {Lazard, Sylvain and Valque, Leo}, + URL = {https://inria.hal.science/hal-04907149}, + NOTE = {working paper or preprint}, + YEAR = {2025}, + MONTH = Jan, + KEYWORDS = {Snap rounding ; mesh intersection ; robustness}, + PDF = {https://inria.hal.science/hal-04907149v1/file/Snap-HAL.pdf}, + HAL_ID = {hal-04907149}, + HAL_VERSION = {v1}, +} diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 08d8d798f41..1240d8107fa 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -4,7 +4,7 @@ namespace CGAL { \anchor Chapter_PolygonMeshProcessing \cgalAutoToc -\authors David Coeurjolly, Jaques-Olivier Lachaud, Konstantinos Katrioplas, Sébastien Loriot, Ivan Pađen, Mael Rouxel-Labbé, Hossam Saeed, Jane Tournois, and Ilker %O. Yaz +\authors David Coeurjolly, Jaques-Olivier Lachaud, Sylvain Lazard, Konstantinos Katrioplas, Sébastien Loriot, Ivan Pađen, Mael Rouxel-Labbé, Hossam Saeed, Jane Tournois, Léo Valque and Ilker %O. Yaz \image html neptun_head.jpg \image latex neptun_head.jpg @@ -889,8 +889,10 @@ 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. -To guarantee that the triangle soup is free from self-intersections, a kernel with exact constructions must be used. +might be introduced due to rounding issues of points coordinates. The `do_snap` 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. + \subsection PMPRemoveCapsNeedles Removal of Almost Degenerate Triangle Faces Triangle faces of a mesh made up of almost collinear points are badly shaped elements that @@ -1439,5 +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}. + */ } /* namespace CGAL */ diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/snap_polygon_soup.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/snap_polygon_soup.cpp index 87ed4a5b978..e577ee4f79e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/snap_polygon_soup.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/snap_polygon_soup.cpp @@ -15,8 +15,6 @@ #include -#include - typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Cartesian Cartesian; typedef Kernel::Point_3 Point; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/autorefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/autorefinement.h index c3edc5315f9..e13fe7aafca 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/autorefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/autorefinement.h @@ -1090,7 +1090,7 @@ bool autorefine_triangle_soup(PointRange& soup_points, if(do_snap) { CGAL_PMP_AUTOREFINE_VERBOSE("Snap polygon soup"); - return internal::snap_polygon_soup(soup_points, soup_triangles, parameters::point_map(pm).snap_grid_size(grid_size).number_of_iterations(nb_of_iteration).erase_all_duplicates(ead).concurrency_tag(Concurrency_tag())); + return internal::snap_polygon_soup(soup_points, soup_triangles, parameters::point_map(pm).visitor(visitor).snap_grid_size(grid_size).number_of_iterations(nb_of_iteration).erase_all_duplicates(ead).concurrency_tag(Concurrency_tag())); } constexpr bool parallel_execution = std::is_same_v; @@ -1760,4 +1760,6 @@ autorefine( TriangleMesh& tm, #endif #endif +#include + #endif // CGAL_POLYGON_MESH_PROCESSING_AUTOREFINEMENT_H