diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 5090535be25..f62b2816cf7 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -200,12 +200,12 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage. - \link PMP_locate_grp Nearest Face Location Queries \endlink - \link PMP_locate_grp Random Location Generation \endlink -\cgalCRPSection{Corrected Curvature Functions} +\cgalCRPSection{Corrected Curvatures} - `CGAL::Polygon_mesh_processing::interpolated_corrected_mean_curvature()` - `CGAL::Polygon_mesh_processing::interpolated_corrected_gaussian_curvature()` - `CGAL::Polygon_mesh_processing::interpolated_corrected_principal_curvatures_and_directions()` - `CGAL::Polygon_mesh_processing::interpolated_corrected_curvatures()` -- `CGAL::Polygon_mesh_processing::Principal_curvature` +- `CGAL::Polygon_mesh_processing::Principal_curvatures_and_directions` \cgalCRPSection{Normal Computation Functions} - `CGAL::Polygon_mesh_processing::compute_face_normal()` 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 2347ae1c7ae..1d7184561a8 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 @@ -879,11 +879,11 @@ not provide storage for the normals. **************************************** \section PMPICC Computing Curvatures -This package provides methods to compute curvatures on polygonal meshes based on \cgalCite{lachaud2020} -This includes mean curvature, gaussian curvature, principal curvatures and directions. -These can be computed on triangle meshes, quad meshes, and meshes with n-gon faces. -The algorithms used prove to work well in general. Also, on meshes with noise -on vertex positions, they give accurate results, on the condition that the +This package provides methods to compute curvatures on polygonal meshes based on Interpolated Corrected Curvatures +on Polyhedral Surfaces \cgalCite{lachaud2020}. This includes mean curvature, gaussian curvature, +principal curvatures and directions. These can be computed on triangle meshes, quad meshes, +and meshes with n-gon faces. The algorithms used prove to work well in general. Also, on meshes +with noise on vertex positions, they give accurate results, on the condition that the correct vertex normals are provided. The implementation is generic in terms of mesh data structure. It can be used on Surface_mesh, @@ -912,13 +912,12 @@ The mean curvature distribution on a bear mesh with different values for the exp Property maps are used to record the computed curvatures as shown in examples. -\subsection ICCExample Interpolated Corrected Curvature Examples Property maps are an API introduced in the boost library that allows associating values to keys. In the following examples, for each property map, we associate a curvature value to each vertex. -\subsubsection ICCExampleSM Interpolated Corrected Curvature on a Surface Mesh. +\subsection ICCExampleSM Interpolated Corrected Curvature on a Surface Mesh Example The following example illustrates how to compute the curvatures on vertices @@ -926,7 +925,7 @@ and store them in property maps provided by the class `Surface_mesh`. \cgalExample{Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp} -\subsubsection ICCExamplePH Interpolated Corrected Curvature on a Polyhedron +\subsection ICCExamplePH Interpolated Corrected Curvature on a Polyhedron Example The following example illustrates how to compute the curvatures on vertices @@ -1143,7 +1142,7 @@ is covered by a set of prisms, where each prism is an offset for an input triang That is, the implementation in \cgal does not use indirect predicates. The interpolated corrected curvatures were implemented during GSoC 2022. This was implemented by Hossam Saeed and under -supervision of Sebastien Loriot, Jaques-Olivier Lachaud and David Coeurjolly. The implementation is based \cgalCite{lachaud2020}. +supervision of Sebastien Loriot, Jaques-Olivier Lachaud and David Coeurjolly. The implementation is based on \cgalCite{lachaud2020}. DGtal's implementation was also used as a reference during the project. diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp index 71aa06a8cae..33d34cd34f1 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp @@ -38,9 +38,9 @@ int main(int argc, char* argv[]) assert(created); // we use a tuple of 2 scalar values and 2 vectors for principal curvatures and directions - Surface_Mesh::Property_map> principal_curvatures_and_directions_map; + Surface_Mesh::Property_map> principal_curvatures_and_directions_map; - boost::tie(principal_curvatures_and_directions_map, created) = smesh.add_property_map> + boost::tie(principal_curvatures_and_directions_map, created) = smesh.add_property_map> ("v:principal_curvatures_and_directions_map", { 0, 0, Epic_kernel::Vector_3(0,0,0), Epic_kernel::Vector_3(0,0,0) }); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp index 50fe1a014d8..6bbe49ce37e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp @@ -30,8 +30,8 @@ int main(int argc, char *argv[]) boost::property_map>::type mean_curvature_map = get(CGAL::dynamic_vertex_property_t(), polyhedron), gaussian_curvature_map = get(CGAL::dynamic_vertex_property_t(), polyhedron); - boost::property_map>>::type - principal_curvatures_and_directions_map = get(CGAL::dynamic_vertex_property_t>(), polyhedron); + boost::property_map>>::type + principal_curvatures_and_directions_map = get(CGAL::dynamic_vertex_property_t>(), polyhedron); PMP::interpolated_corrected_mean_curvature( polyhedron, diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Curvatures/interpolated_corrected_curvature_measures.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Curvatures/interpolated_corrected_curvature_measures.h index 3b02341a212..6ed11404a25 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Curvatures/interpolated_corrected_curvature_measures.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Curvatures/interpolated_corrected_curvature_measures.h @@ -43,7 +43,7 @@ namespace Polygon_mesh_processing { * @tparam GT is the geometric traits class. */ template -struct Principal_curvature { +struct Principal_curvatures_and_directions { /// min curvature magnitude typename GT::FT min_curvature; @@ -57,14 +57,14 @@ struct Principal_curvature { /// max curvature direction vector typename GT::Vector_3 max_direction; - Principal_curvature() { + Principal_curvatures_and_directions() { min_curvature = 0; max_curvature = 0; min_direction = typename GT::Vector_3(0, 0, 0); max_direction = typename GT::Vector_3(0, 0, 0); } - Principal_curvature( + Principal_curvatures_and_directions( typename GT::FT min_curvature, typename GT::FT max_curvature, typename GT::Vector_3 min_direction, @@ -440,7 +440,7 @@ namespace internal { } template - Principal_curvature principal_curvatures_and_directions_from_anisotropic_measures( + Principal_curvatures_and_directions principal_curvatures_and_directions_from_anisotropic_measures( const std::array anisotropic_measure, const typename GT::FT v_mu0, const typename GT::Vector_3 u_GT @@ -462,7 +462,7 @@ namespace internal { eigensolver.computeDirect(v_muXY); if (eigensolver.info() != Eigen::Success) - return Principal_curvature(); + return Principal_curvatures_and_directions(); const Eigen::Matrix eig_vals = eigensolver.eigenvalues(); const Eigen::Matrix eig_vecs = eigensolver.eigenvectors(); @@ -470,7 +470,7 @@ namespace internal { const typename GT::Vector_3 min_eig_vec(eig_vecs(0, 1), eig_vecs(1, 1), eig_vecs(2, 1)); const typename GT::Vector_3 max_eig_vec(eig_vecs(0, 0), eig_vecs(1, 0), eig_vecs(2, 0)); - return Principal_curvature( + return Principal_curvatures_and_directions( (v_mu0 != 0.0) ? -eig_vals[1] / v_mu0 : 0.0, (v_mu0 != 0.0) ? -eig_vals[0] / v_mu0 : 0.0, min_eig_vec, @@ -509,7 +509,7 @@ namespace internal { NamedParameters, Default_scalar_map>::type Vertex_gaussian_curvature_map; - typedef Constant_property_map> Default_principal_map; + typedef Constant_property_map> Default_principal_map; typedef typename internal_np::Lookup_named_param_def::type Vertex_principal_curvatures_and_directions_map; @@ -735,7 +735,7 @@ namespace internal { if (is_principal_curvatures_and_directions_selected) { const Vector_3 v_normal = get(vnm, v); - const Principal_curvature principal_curvatures_and_directions = principal_curvatures_and_directions_from_anisotropic_measures( + const Principal_curvatures_and_directions principal_curvatures_and_directions = principal_curvatures_and_directions_from_anisotropic_measures( vertex_measures.anisotropic_measure, vertex_measures.area_measure, v_normal @@ -997,8 +997,8 @@ template::%Vertex_descriptor` -* as key type and `%Principal_curvature` as value type} -* \cgalParamDefault{`get(dynamic_vertex_property_t>(), pmesh)`} +* as key type and `%Principal_curvatures_and_directions` as value type} +* \cgalParamDefault{`get(dynamic_vertex_property_t>(), pmesh)`} * \cgalParamExtra{If this parameter is omitted, mean principal won't be computed} * \cgalParamNEnd *