mirror of https://github.com/CGAL/cgal
Apply suggestions from code review
Co-authored-by: Jane Tournois <janetournois@users.noreply.github.com>
This commit is contained in:
parent
7b7dfa2e0a
commit
178d967d4b
|
|
@ -15,15 +15,15 @@ public:
|
||||||
typedef boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
|
typedef boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
|
||||||
|
|
||||||
/// Halfedge descriptor type
|
/// 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;
|
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;
|
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;
|
typedef unspecified_type FT;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
@ -37,19 +37,18 @@ typedef unspecified_type FT;
|
||||||
std::optional<FT> is_too_long(const halfedge_descriptor h,
|
std::optional<FT> is_too_long(const halfedge_descriptor h,
|
||||||
const PolygonMesh& pmesh) const;
|
const PolygonMesh& pmesh) const;
|
||||||
|
|
||||||
/// called to check whether the halfedge with end vertices `va` and `vb` is longer
|
/// a function controlling edge split and edge collapse,
|
||||||
/// than the target edge size and as such should be split. If the halfedge is longer,
|
/// returning the squared distance between the points of `va` and `vb`
|
||||||
/// it returns the squared length of the edge.
|
/// 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,
|
std::optional<FT> is_too_long(const vertex_descriptor va,
|
||||||
const vertex_descriptor vb) const;
|
const vertex_descriptor vb) const;
|
||||||
|
|
||||||
/// called to check whether the halfedge `h` should be collapsed in case it is
|
/// a function controlling edge collapse by returning the squared length of `h`
|
||||||
/// shorter than the target edge size.
|
/// if it is too short, and `std::nullopt` otherwise.
|
||||||
std::optional<FT> is_too_short(const halfedge_descriptor h,
|
std::optional<FT> is_too_short(const halfedge_descriptor h,
|
||||||
const PolygonMesh& pmesh) const;
|
const PolygonMesh& pmesh) const;
|
||||||
|
|
||||||
/// called to define the location of the halfedge `h` split in case `is_too_long()`
|
/// a function returning the location of the split point of the edge of `h`.
|
||||||
/// returns a value.
|
|
||||||
Point_3 split_placement(const halfedge_descriptor h,
|
Point_3 split_placement(const halfedge_descriptor h,
|
||||||
const PolygonMesh& pmesh) const;
|
const PolygonMesh& pmesh) const;
|
||||||
/// @}
|
/// @}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
\cgalPkgPicture{hole_filling_ico.png}
|
\cgalPkgPicture{hole_filling_ico.png}
|
||||||
|
|
||||||
\cgalPkgSummaryBegin
|
\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,
|
\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
|
ranging from basic operations on simplices, to complex geometry processing algorithms such as
|
||||||
Boolean operations, remeshing, repairing, collision and intersection detection, and more.}
|
Boolean operations, remeshing, repairing, collision and intersection detection, and more.}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ namespace CGAL {
|
||||||
\anchor Chapter_PolygonMeshProcessing
|
\anchor Chapter_PolygonMeshProcessing
|
||||||
|
|
||||||
\cgalAutoToc
|
\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 html neptun_head.jpg
|
||||||
\image latex neptun_head.jpg
|
\image latex neptun_head.jpg
|
||||||
|
|
@ -120,10 +120,9 @@ by \cgalFigureRef{iso_remeshing}. The algorithm has two parameters:
|
||||||
the sizing field object for the remeshed surface patch, and
|
the sizing field object for the remeshed surface patch, and
|
||||||
the number of iterations of the abovementioned sequence of operations.
|
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
|
The sizing field establishes the local target edge length for the remeshed surface. Two sizing fields are
|
||||||
adaptive. With the uniform sizing field, initiated by the `CGAL::Polygon_mesh_processing::Uniform_sizing_field()` constructor,
|
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. On the other hand, with the adaptive sizing field, initiated by
|
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 --
|
||||||
the `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
|
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
|
field algorithm is available in \cgalCite{dunyach2013curvRemesh}. The distinction between uniform and adaptive
|
||||||
sizing fields is depicted in figure \cgalFigureRef{uniform_and_adaptive}.
|
sizing fields is depicted in figure \cgalFigureRef{uniform_and_adaptive}.
|
||||||
|
|
@ -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
|
<a href="https://dgtal-team.github.io/doc-nightly/moduleCurvatureMeasures.html">DGtal's implementation</a> was also
|
||||||
used as a reference during the project.
|
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 */
|
} /* namespace CGAL */
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Polygon_mesh_processing
|
||||||
* The local discrete curvatures are calculated using the
|
* The local discrete curvatures are calculated using the
|
||||||
* `CGAL::Polygon_mesh_processing::interpolated_corrected_principal_curvatures_and_directions()` function.
|
* `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.
|
* edges shorter than the local target edge length are collapsed.
|
||||||
*
|
*
|
||||||
* \cgalModels{PMPSizingField}
|
* \cgalModels{PMPSizingField}
|
||||||
|
|
@ -70,7 +70,7 @@ public:
|
||||||
/// \name Creation
|
/// \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`,
|
* @tparam FaceRange range of `boost::graph_traits<PolygonMesh>::%face_descriptor`,
|
||||||
* model of `Range`. Its iterator type is `ForwardIterator`.
|
* model of `Range`. Its iterator type is `ForwardIterator`.
|
||||||
|
|
@ -78,27 +78,19 @@ public:
|
||||||
*
|
*
|
||||||
* @param tol the error tolerance, used together with curvature to derive target edge length.
|
* @param tol the error tolerance, used together with curvature to derive target edge length.
|
||||||
* Lower tolerance values will result in shorter mesh edges.
|
* Lower tolerance values will result in shorter mesh edges.
|
||||||
* @param edge_len_min_max is the stopping criterion for minimum and maximum allowed
|
* @param edge_len_min_max contains the bounds for minimum and maximum
|
||||||
* edge length.
|
* edge lengths
|
||||||
* @param face_range the range of triangular faces defining one or several surface patches
|
* @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
|
* \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
|
* @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
|
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||||
|
|
||||||
* \cgalNamedParamsBegin
|
* \cgalNamedParamsBegin
|
||||||
* \cgalParamNBegin{ball_radius}
|
* \cgalParamNBegin{ball_radius}
|
||||||
* \cgalParamDescription{a scalar value specifying the radius used for expanding curvature measures.
|
* \cgalParamDescription{`ball_radius` parameter passed to `interpolated_corrected_curvatures()`}
|
||||||
* 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.}
|
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
* \cgalNamedParamsEnd
|
* \cgalNamedParamsEnd
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ namespace Polygon_mesh_processing
|
||||||
* \ingroup PMP_meshing_grp
|
* \ingroup PMP_meshing_grp
|
||||||
* provides criteria for isotropic remeshing to achieve uniform mesh edge lengths.
|
* 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 longer than 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 shorter than 4/5 of the target edge length will be collapsed.
|
||||||
*
|
*
|
||||||
* \cgalModels{PMPSizingField}
|
* \cgalModels{PMPSizingField}
|
||||||
*
|
*
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Polygon_mesh_processing
|
||||||
* @tparam PolygonMesh model of `MutableFaceGraph` that
|
* @tparam PolygonMesh model of `MutableFaceGraph` that
|
||||||
* has an internal property map for `CGAL::vertex_point_t`.
|
* has an internal property map for `CGAL::vertex_point_t`.
|
||||||
* @tparam VPMap a property map associating points to the vertices of `pmesh`.
|
* @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)`.
|
* as key type and `%Point_3` as value type. Default is `boost::get(CGAL::vertex_point, pmesh)`.
|
||||||
*/
|
*/
|
||||||
template <class PolygonMesh,
|
template <class PolygonMesh,
|
||||||
|
|
@ -61,11 +61,11 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* returns an object to serve as criterion for uniform edge lengths.
|
* Constructor.
|
||||||
* \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.
|
* 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
|
* \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)
|
Uniform_sizing_field<PolygonMesh, VPMap>(const FT size, const VPMap& vpmap)
|
||||||
: m_sq_short( CGAL::square(4./5. * size))
|
: m_sq_short( CGAL::square(4./5. * size))
|
||||||
|
|
@ -74,10 +74,9 @@ public:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* 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.
|
* 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
|
* @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.
|
* vertex point map of pmesh is used to construct the class.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue