From 47b4a3941b6d04d1cd802b769bb2da7506e46fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 11 Jul 2017 16:28:41 +0200 Subject: [PATCH] update user and reference manual --- .../PackageDescription.txt | 5 +++- .../Polygon_mesh_processing.txt | 23 ++++++++++++++++--- .../autorefinement_sm.cpp | 4 ++-- .../Polygon_mesh_processing/corefinement.h | 10 ++++---- .../Polygon_mesh_processing/intersection.h | 6 ++--- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 6be846bc625..e808b45bd6a 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -131,12 +131,15 @@ and provides a list of the parameters that are used in this package. - \link keep_connected_components_grp `CGAL::Polygon_mesh_processing::keep_connected_components()` \endlink - \link keep_connected_components_grp `CGAL::Polygon_mesh_processing::remove_connected_components()` \endlink -## Corefinement and Boolean Operation Functions ## +## Autorefinement, Corefinement, and Boolean Operation Functions ## +- `CGAL::Polygon_mesh_processing::autorefine()` +- `CGAL::Polygon_mesh_processing::autorefine_and_remove_self_intersections()` - `CGAL::Polygon_mesh_processing::corefine_and_compute_union()` - `CGAL::Polygon_mesh_processing::corefine_and_compute_difference()` - `CGAL::Polygon_mesh_processing::corefine_and_compute_intersection()` - `CGAL::Polygon_mesh_processing::corefine()` - `CGAL::Polygon_mesh_processing::surface_intersection()` +- `CGAL::Polygon_mesh_processing::surface_self_intersection()` - `CGAL::Polygon_mesh_processing::does_bound_a_volume()` ## Geometric Measure Functions ## 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 24b67d7a036..c925a80595f 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 @@ -156,7 +156,11 @@ Once this is done, remeshing is run on all the surface, with protection of const Corefinement Given two triangulated surface meshes, the corefinement operation consists in refining both meshes so that their intersection polylines are a subset of edges in both refined meshes. -\todo more information on coplanar patches. + + Autorefinement Given a triangulated surface mesh, the autorefinement +operation consists in refining the mesh by inserting the result of the intersection +of each pair of non edge-adjacent triangles into the corresponding triangle faces, +keeping the mesh triangulated. \cgalFigureBegin{coref_fig, corefine.png} Corefinement of two triangulated surface meshes. (Left) Input meshes; (Right) @@ -197,6 +201,19 @@ intersection of the input meshes will be marked as constrained. In addition, if an edge that was marked as constrained is split during the corefinement, sub-edges will be marked as constrained as well. +\subsection coref_autoref_subsec Autorefinement +The autorefinement of a triangulated surface mesh can be done using the function +`CGAL::Polygon_mesh_processing::autorefine()`. It takes as input the +triangulated surface mesh to autorefine. +If a constrained edge map is provided, edges belonging to the +self-intersection of the input mesh will be marked as constrained. In addition, +if an edge that was marked as constrained is split during the autorefinement, +sub-edges will be marked as constrained as well. +As a byproduct, the function `CGAL::Polygon_mesh_processing::autorefine_and_remove_self_intersections()` +will use the autorefinement of a triangle mesh to try to fix its self-intersections +by removing some patches bounded by self-intersection edges and by stitching +those edges. + \subsection coref_bolop_subsec Boolean Operations \cgalFigureBegin{boolop_fig, bool_op.png} @@ -235,8 +252,8 @@ possible, the input mesh will nevertheless be corefined. \subsection coref_valid_subsec Kernel and Validity of the Output -The corefinement operation (which is also internally used in the three -Boolean operations) will correctly change the topology of the input surface mesh +The autorefinement and corefinement operations (which is also internally used in the three +Boolean operations) will correctly change the topology of the input surface meshes if the point type used in the point property maps of the input meshes is from a \cgal Kernel with exact predicates. If that kernel does not have exact constructions, the embedding of the output surface mesh might diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/autorefinement_sm.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/autorefinement_sm.cpp index f6b5e97f74f..fb2781462e5 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/autorefinement_sm.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/autorefinement_sm.cpp @@ -24,10 +24,10 @@ int main(int argc, char* argv[]) } input.close(); - std::cout << "Test surface_autointersection\n"; + std::cout << "Test surface_self_intersection\n"; std::vector< std::vector >polylines; - PMP::surface_autointersection(mesh, std::back_inserter(polylines)); + PMP::surface_self_intersection(mesh, std::back_inserter(polylines)); //dump polylines std::ofstream output("intersection_polylines.cgal"); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h index 8c186346a2b..29482875951 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/corefinement.h @@ -672,7 +672,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, /** * \ingroup PMP_corefinement_grp - * \link autoef_def_subsec autorefines \endlink `tm`. Refines a triangle mesh + * \link coref_def_subsec autorefines \endlink `tm`. Refines a triangle mesh * so that no triangles intersects in their interior. * Self-intersection edges will be marked as constrained. If an edge that was marked as * constrained is split, its sub-edges will be marked as constrained as well. @@ -682,7 +682,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, * * @param tm input triangulated surface mesh * @param np optional sequence of \ref namedparameters among the ones listed below - + * * \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} * the property map with the points associated to the vertices of `tm`. @@ -737,8 +737,8 @@ corefine_and_compute_difference( TriangleMesh& tm1, /** * \ingroup PMP_corefinement_grp - * Removes self-intersections in `tm` by \link autoref_def_subsec autorefining \endlink `tm`, - * removing extra patches, and stitching autointersection edges. + * Removes self-intersections in `tm` by \link coref_def_subsec autorefining \endlink `tm`, + * removing extra patches, and stitching self-intersection edges. * Self-intersection edges will be marked as constrained. If an edge that was marked as * constrained is split, its sub-edges will be marked as constrained as well. * \return `true` if all self-intersections were fixed and `false` otherwise. @@ -758,7 +758,7 @@ corefine_and_compute_difference( TriangleMesh& tm1, * \cgalParamBegin{edge_is_constrained_map} a property map containing the * constrained-or-not status of each edge of `tm` * \cgalParamEnd -* \cgalParamBegin{face_index_map} a property map containing the index of each face of `tm1` (`tm2`) \cgalParamEnd +* \cgalParamBegin{face_index_map} a property map containing the index of each face of `tm` \cgalParamEnd * \cgalNamedParamsEnd * */ diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 89a56bc9b34..21e929bd11f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -127,7 +127,7 @@ template OutputIterator -surface_autointersection(const TriangleMesh& tm, +surface_self_intersection(const TriangleMesh& tm, OutputIterator polyline_output, const NamedParameters& np) { @@ -165,10 +165,10 @@ surface_intersection(const TriangleMesh& tm1, template OutputIterator -surface_autointersection(const TriangleMesh& tm, +surface_self_intersection(const TriangleMesh& tm, OutputIterator polyline_output) { - return surface_autointersection(tm, polyline_output, + return surface_self_intersection(tm, polyline_output, CGAL::Polygon_mesh_processing::parameters::all_default() ); }