Add documentation for iterative authalic parameterizer

This commit is contained in:
Mael Rouxel-Labbé 2020-07-22 12:23:14 +02:00
parent 2959843a19
commit eb56ec4f48
5 changed files with 55 additions and 37 deletions

View File

@ -299,6 +299,25 @@ for both systems) is asymmetric.
Floater Mean Value Coordinates. Rightmost: parameter space.
\cgalFigureCaptionEnd
\subsubsection Surface_mesh_parameterizationIterativeAuthalic Iterative Authalic Parameterization
`Surface_mesh_parameterization::Iterative_authalic_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>`
The Iterative Authalic parameterization method has been introduced by
Jain et al. \cgalCite{cgal:j-lrsspp-19}. This parameterization
is a fixed border parameterization and is part of the authalic parameterization family,
meaning that it aims to minimize area distortion between the input surface mesh and the parameterized output.
More precisely, the approach used by this parameterizer is to iteratively redistribute
the \f$ L_2\f$ stretch - as defined by Sander et al. \cgalCite{cgal:ssgh-tmpm-01} - over the mesh.
\cgalFigureAnchor{Surface_mesh_parameterizationfigiterativeauthalic}
<center>
<img src="iterative_authalic.jpg" style="max-width:70%;"/>
</center>
\cgalFigureCaptionBegin{Surface_mesh_parameterizationfigiterativeauthalic}
Iterative Authalic Parameterization (the blue line depicts the cut graph). Rightmost: parameter space.
\cgalFigureCaptionEnd
\subsubsection secBorderParameterizationsforFixedMethods Border Parameterizations for Fixed Methods
Parameterization methods for borders are used as traits classes modifying the

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 KiB

View File

@ -50,7 +50,7 @@ int main(int argc, char** argv)
typedef SMP::Iterative_authalic_parameterizer_3<Surface_mesh, Border_parameterizer> Parameterizer;
Parameterizer parameterizer(border_parameterizer);
const int iterations = (argc > 2) ? std::atoi(argv[2]) : 15;
const unsigned int iterations = (argc > 2) ? std::atoi(argv[2]) : 15;
SMP::Error_code err = parameterizer.parameterize(sm, bhd, uv_map, iterations);
if(err != SMP::OK)

View File

@ -851,34 +851,6 @@ public:
}
}
/// computes a one-to-one mapping from a triangular 3D surface mesh
/// to a piece of the 2D space.
/// The mapping is piecewise linear (linear in each triangle).
/// The result is the `(u,v)` pair image of each vertex of the 3D surface.
///
/// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`)
/// as value type.
/// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// a unique integer as value type.
/// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// a Boolean as value type.
///
/// \param tmesh a triangulated surface
/// \param bhd a halfedge descriptor on the boundary of `mesh`
/// \param uvmap an instanciation of the class `VertexUVmap`
/// \param vimap an instanciation of the class `VertexIndexMap`
/// \param vpmap an instanciation of the class `VertexParameterizedMap`
/// \param iterations an integer number of iterations to run the parameterization
/// \param error return error value of the iterative process
///
/// \pre `tmesh` must be a triangular mesh.
/// \pre The mesh border must be mapped onto a convex polygon.
/// \pre The vertices must be indexed (`vimap` must be initialized).
///
template <typename VertexUVmap,
typename VertexIndexMap,
typename VertexParameterizedMap>
@ -887,7 +859,7 @@ public:
VertexUVmap uvmap,
VertexIndexMap vimap,
VertexParameterizedMap vpmap,
int& iterations,
unsigned int& iterations,
double& error)
{
CGAL_precondition(is_valid_polygon_mesh(tmesh));
@ -936,12 +908,12 @@ public:
if(DEBUG_L0)
std::cout << std::endl;
int last_best_i = 0;
unsigned int last_best_i = 0;
NT gamma = 1; // @todo what value should that be
bool is_changed = false;
// iterate it with the new weights
int i = 0;
unsigned int i = 0;
while(i < iterations)
{
if(DEBUG_L0)
@ -1101,12 +1073,39 @@ public:
VertexUVmap uvmap,
VertexIndexMap vimap,
VertexParameterizedMap vpmap,
int& iterations)
unsigned int& iterations)
{
double unused_error;
return parameterize(tmesh, bhd, uvmap, vimap, vpmap, iterations, unused_error);
}
/// computes a one-to-one mapping from a triangular 3D surface mesh
/// to a piece of the 2D space.
/// The mapping is piecewise linear (linear in each triangle).
/// The result is the `(u,v)` pair image of each vertex of the 3D surface.
///
/// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`)
/// as value type.
/// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// a unique integer as value type.
/// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with
/// `boost::graph_traits<Triangle_mesh>::%vertex_descriptor` as key type and
/// a Boolean as value type.
///
/// \param tmesh a triangulated surface
/// \param bhd a halfedge descriptor on the boundary of `mesh`
/// \param uvmap an instanciation of the class `VertexUVmap`
/// \param vimap an instanciation of the class `VertexIndexMap`
/// \param vpmap an instanciation of the class `VertexParameterizedMap`
/// \param iterations an integer number of iterations to run the parameterization
///
/// \pre `tmesh` must be a triangular mesh.
/// \pre The mesh border must be mapped onto a convex polygon.
/// \pre The vertices must be indexed (`vimap` must be initialized).
///
template <typename VertexUVmap,
typename VertexIndexMap,
typename VertexParameterizedMap>
@ -1115,7 +1114,7 @@ public:
VertexUVmap uvmap,
VertexIndexMap vimap,
VertexParameterizedMap vpmap,
const int& iterations = 15)
const unsigned int iterations = 15)
{
int iter = iterations; // need a non-const ref
return parameterize(tmesh, bhd, uvmap, vimap, vpmap, iter);
@ -1125,7 +1124,7 @@ public:
Error_code parameterize(Triangle_mesh& tmesh,
halfedge_descriptor bhd,
VertexUVmap uvmap,
const int iterations = 15)
const unsigned int iterations = 15)
{
Vertex_int_map vimap = get(Vertex_int_tag(), tmesh);
internal::fill_index_map_of_cc(bhd, tmesh, vimap);
@ -1138,7 +1137,7 @@ public:
template <typename VertexUVmap>
Error_code parameterize(Triangle_mesh& tmesh,
VertexUVmap uvmap,
const int iterations = 15)
const unsigned int iterations = 15)
{
const halfedge_descriptor bhd = Polygon_mesh_processing::longest_border(tmesh).first;

View File

@ -513,7 +513,7 @@ int main(int, char**)
SMP::Iterative_authalic_parameterizer_3<SMesh> parameterizer;
double error = 0;
int iterations = 15;
unsigned int iterations = 15;
SMP::Error_code status = parameterizer.parameterize(sm, hd, uvpm, vipm, vpm, iterations, error);
SMP::Error_code status_bis = parameterizer.parameterize(sm, uvpm, 10);