Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jane Tournois <[email protected]>
  • Loading branch information
ipadjen and janetournois authored Sep 29, 2023
1 parent c646a38 commit 4adbc78
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class PMPSizingField{
typedef boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;

/// Halfedge descriptor type
typedef unspecified_type halfedge_descriptor;
typedef boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;

/// 3D point type
/// 3D point type matching the value type of the vertex property map passed to `CGAL::Polygon_mesh_processing::isotropic_remeshing()`
typedef unspecified_type Point_3;

/// Polygon mesh type
/// Polygon mesh type matching the type passed to `CGAL::Polygon_mesh_processing::isotropic_remeshing()`
typedef unspecified_type PolygonMesh;

/// Numerical type
/// Number type matching the `FT` type of the geometric traits passed to `CGAL::Polygon_mesh_processing::isotropic_remeshing()`
typedef unspecified_type FT;

/// @}
Expand All @@ -44,19 +44,18 @@ typedef unspecified_type FT;
std::optional<FT> is_too_long(const halfedge_descriptor h,
const PolygonMesh& pmesh) const;

/// called to check whether the halfedge with end vertices `va` and `vb` is longer
/// than the target edge size and as such should be split. If the halfedge is longer,
/// it returns the squared length of the edge.
/// a function controlling edge split and edge collapse,
/// returning the squared distance between the points of `va` and `vb`
/// if an edge between `va` and `vb` would be too long, and `std::nullopt` otherwise.
std::optional<FT> is_too_long(const vertex_descriptor va,
const vertex_descriptor vb) const;

/// called to check whether the halfedge `h` should be collapsed in case it is
/// shorter than the target edge size.
/// a function controlling edge collapse by returning the squared length of `h`
/// if it is too short, and `std::nullopt` otherwise.
std::optional<FT> is_too_short(const halfedge_descriptor h,
const PolygonMesh& pmesh) const;

/// called to define the location of the halfedge `h` split in case `is_too_long()`
/// returns a value.
/// a function returning the location of the split point of the edge of `h`.
Point_3 split_placement(const halfedge_descriptor h,
const PolygonMesh& pmesh) const;
/// @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
\cgalPkgPicture{hole_filling_ico.png}

\cgalPkgSummaryBegin
\cgalPkgAuthors{David Coeurjolly, Jaques-Olivier Lachaud, Konstantinos Katriopla, Sébastien Loriot, Mael Rouxel-Labbé, Hossam Saeed, Jane Tournois, and Ilker %O. Yaz}
\cgalPkgAuthors{David Coeurjolly, Jaques-Olivier Lachaud, Konstantinos Katrioplas, Sébastien Loriot, Ivan Pađen, Mael Rouxel-Labbé, Hossam Saeed, Jane Tournois, and Ilker %O. Yaz}
\cgalPkgDesc{This package provides a collection of methods and classes for polygon mesh processing,
ranging from basic operations on simplices, to complex geometry processing algorithms such as
Boolean operations, remeshing, repairing, collision and intersection detection, and more.}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace CGAL {
\anchor Chapter_PolygonMeshProcessing

\cgalAutoToc
\authors David Coeurjolly, Jaques-Olivier Lachaud, Konstantinos Katriopla, Sébastien Loriot, Mael Rouxel-Labbé, Hossam Saeed, Jane Tournois, and Ilker %O. Yaz
\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

\image html neptun_head.jpg
\image latex neptun_head.jpg
Expand Down Expand Up @@ -120,10 +120,9 @@ by \cgalFigureRef{iso_remeshing}. The algorithm has two parameters:
the sizing field object for the remeshed surface patch, and
the number of iterations of the abovementioned sequence of operations.

The sizing field establishes the target edge length for the remeshed surface. The sizing field can be uniform or
adaptive. With the uniform sizing field, initiated by the `CGAL::Polygon_mesh_processing::Uniform_sizing_field()` constructor,
all triangle edges are targeted to have equal lengths. On the other hand, with the adaptive sizing field, initiated by
the `CGAL::Polygon_mesh_processing::Adaptive_sizing_field()`, triangle edge lengths depend on the local curvature --
The sizing field establishes the local target edge length for the remeshed surface. Two sizing fields are
provided: a uniform and a curvature-adaptive sizing field. With `CGAL::Polygon_mesh_processing::Uniform_sizing_field`,
all triangle edges are targeted to have equal lengths. With `CGAL::Polygon_mesh_processing::Adaptive_sizing_field`, triangle edge lengths depend on the local curvature --
shorter edges appear in regions with a higher curvature and vice versa. The outline of the adaptive sizing
field algorithm is available in \cgalCite{dunyach2013curvRemesh}. The distinction between uniform and adaptive
sizing fields is depicted in figure \cgalFigureRef{uniform_and_adaptive}.
Expand Down Expand Up @@ -1286,5 +1285,7 @@ supervision of David Coeurjolly, Jaques-Olivier Lachaud, and Sébastien Loriot.
<a href="https://dgtal-team.github.io/doc-nightly/moduleCurvatureMeasures.html">DGtal's implementation</a> was also
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.

*/
} /* namespace CGAL */
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Polygon_mesh_processing
* The local discrete curvatures are calculated using the
* `CGAL::Polygon_mesh_processing::interpolated_corrected_principal_curvatures_and_directions()` function.
*
* Edges longer than the local target edge length are split in half, while
* Edges longer than the local target edge length are split in two, while
* edges shorter than the local target edge length are collapsed.
*
* \cgalModels{PMPSizingField}
Expand Down Expand Up @@ -70,35 +70,27 @@ class Adaptive_sizing_field
/// \name Creation
/// @{
/*!
* returns an object to serve as criteria for adaptive curvature-based edge lengths.
* constructor
*
* @tparam FaceRange range of `boost::graph_traits<PolygonMesh>::%face_descriptor`,
* model of `Range`. Its iterator type is `ForwardIterator`.
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
*
* @param tol the error tolerance, used together with curvature to derive target edge length.
* Lower tolerance values will result in shorter mesh edges.
* @param edge_len_min_max is the stopping criterion for minimum and maximum allowed
* edge length.
* @param edge_len_min_max contains the bounds for minimum and maximum
* edge lengths
* @param face_range the range of triangular faces defining one or several surface patches
* to be remeshed. It should be the same as the range of faces used for `isotropic_remeshing()`.
* to be remeshed. It should be the same as the range of faces passed to `isotropic_remeshing()`.
* \param vpmap is the input vertex point map that associates points to the vertices of
* an input mesh.
* the input mesh.
* @param pmesh a polygon mesh with triangulated surface patches to be remeshed. It should be the
* same mesh as the one used in `isotropic_remeshing()`.
* same mesh as the one passed to `isotropic_remeshing()`.
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
* \cgalNamedParamsBegin
* \cgalParamNBegin{ball_radius}
* \cgalParamDescription{a scalar value specifying the radius used for expanding curvature measures.
* It can potentially smooth the curvature and consequently the sizing field in the
* case of noisy input.}
* \cgalParamDescription{a scalar value specifying the radius used for expanding curvature measures.
* It can effectively smooth the curvature field and consequently the sizing field.}
* \cgalParamType{`Base::FT`}
* \cgalParamDefault{`-1`}
* \cgalParamExtra{If this parameter is omitted (`-1`), the expansion will just by a weightless sum of
* measures on faces around the vertex.}
* \cgalParamDescription{`ball_radius` parameter passed to `interpolated_corrected_curvatures()`}
* \cgalParamNEnd
* \cgalNamedParamsEnd
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace Polygon_mesh_processing
* \ingroup PMP_meshing_grp
* provides criteria for isotropic remeshing to achieve uniform mesh edge lengths.
*
* Edges longer than the 4/3 of the target edge length will be split in half, while
* edges shorter than the 4/5 of the target edge length will be collapsed.
* Edges longer than 4/3 of the target edge length will be split in half, while
* edges shorter than 4/5 of the target edge length will be collapsed.
*
* \cgalModels{PMPSizingField}
*
Expand All @@ -38,7 +38,7 @@ namespace Polygon_mesh_processing
* @tparam PolygonMesh model of `MutableFaceGraph` that
* has an internal property map for `CGAL::vertex_point_t`.
* @tparam VPMap a property map associating points to the vertices of `pmesh`.
* It is a a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
* It is a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
* as key type and `%Point_3` as value type. Default is `boost::get(CGAL::vertex_point, pmesh)`.
*/
template <class PolygonMesh,
Expand All @@ -61,11 +61,11 @@ class Uniform_sizing_field
/// @{

/*!
* returns an object to serve as criterion for uniform edge lengths.
* \param size is the target edge length for the isotropic remeshing. If set to 0,
* Constructor.
* \param size the target edge length for isotropic remeshing. If set to 0,
* the criterion for edge length is ignored and edges are neither split nor collapsed.
* \param vpmap is the input vertex point map that associates points to the vertices of
* an input mesh.
* the input mesh.
*/
Uniform_sizing_field<PolygonMesh, VPMap>(const FT size, const VPMap& vpmap)
: m_sq_short( CGAL::square(4./5. * size))
Expand All @@ -74,10 +74,9 @@ class Uniform_sizing_field
{}

/*!
* returns an object to serve as criterion for uniform edge lengths. It calls the first
* constructor using default values for the vertex point map of the input polygon mesh.
* Constructor using default values for the vertex point map of the input polygon mesh.
*
* @param size is the target edge length for the isotropic remeshing. If set to 0,
* @param size the target edge length for isotropic remeshing. If set to 0,
* the criterion for edge length is ignored and edges are neither split nor collapsed.
* @param pmesh a polygon mesh with triangulated surface patches to be remeshed. The default
* vertex point map of pmesh is used to construct the class.
Expand Down

0 comments on commit 4adbc78

Please sign in to comment.