\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.4 - Planar Parameterization of Triangulated Surface Meshes
CGAL::Surface_mesh_parameterization::ARAP_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ > Class Template Reference

#include <CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h>

Definition

template<class TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
class CGAL::Surface_mesh_parameterization::ARAP_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >

The class ARAP_parameterizer_3 implements the Local/Global Approach to Mesh Parameterization [8].

This parameterization allows the user to prioritize angle preservation, shape preservation, or a balance of both. A parameter \(\lambda\) controls whether the priority is given to angle or to shape preservation: when \(\lambda=0\), the parameterization is as-similar-as-possible (ASAP) and is equivalent to the (conforming) LSCM parameterization. As \(\lambda\) grows, the shape preservation becomes more and more important, yielding, when \(\lambda\) goes to infinity, a parameterization that is as-rigid-as-possible (ARAP).

This is a free border parameterization. There is no need to map the border of the surface onto a convex polygon. When \(\lambda=0\), only two pinned vertices are needed to ensure a unique solution. When \(\lambda\) is non-null, the border does not need to be parameterized and a random vertex is pinned.

If flips are present in the initial parameterization, a post-processing step is applied using CGAL::Surface_mesh_parameterization::MVC_post_processor_3<TriangleMesh, SolverTraits_> to attempt to obtain a valid final embedding.

A one-to-one mapping is not guaranteed.

Is Model Of:
Parameterizer_3
Template Parameters
TriangleMesh_must be a model of FaceGraph.
BorderParameterizer_is a Strategy to parameterize the surface border and must be a model of Parameterizer_3.
Default:
Two_vertices_parameterizer_3<TriangleMesh_>
SolverTraits_must be a model of SparseLinearAlgebraTraits_d.
Note that the system is not symmetric.
Default: If Eigen 3.1 (or greater) is available and CGAL_EIGEN3_ENABLED is defined, then an overload of Eigen_solver_traits is provided as default parameter:
Eigen::SparseLU<Eigen_sparse_matrix<double>::EigenType> >
Moreover, if SparseSuite solvers are available, which is greatly preferable for speed, then the default parameter is:
Eigen::UmfPackLU<Eigen_sparse_matrix<double>::EigenType> >
See also
CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>

Public Types

typedef Border_parameterizer_ Border_parameterizer
 
typedef SolverTraits_ Solver_traits
 
typedef TriangleMesh_ TriangleMesh
 

Public Member Functions

template<typename VertexUVMap >
bool is_one_to_one_mapping (const TriangleMesh &mesh, const Faces_vector &faces, const VertexUVMap uvmap) const
 Check if the 3D -> 2D mapping is one-to-one.
 
template<typename VertexUVMap , typename VertexIndexMap , typename VertexParameterizedMap >
Error_code parameterize (TriangleMesh &mesh, halfedge_descriptor bhd, VertexUVMap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap)
 Compute a mapping from a triangular 3D surface mesh to a piece of the 2D space. More...
 
 ARAP_parameterizer_3 (NT lambda)
 Constructor taking only the parameter \(\lambda\).
 
 ARAP_parameterizer_3 (Border_parameterizer border_param=Border_parameterizer(), Solver_traits sparse_la=Solver_traits(), NT lambda=1000., unsigned int iterations=50, NT tolerance=1e-6)
 Default Constructor. More...
 

Constructor & Destructor Documentation

◆ ARAP_parameterizer_3()

template<class TriangleMesh_ , class BorderParameterizer_ = Default, class SolverTraits_ = Default>
CGAL::Surface_mesh_parameterization::ARAP_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::ARAP_parameterizer_3 ( Border_parameterizer  border_param = Border_parameterizer(),
Solver_traits  sparse_la = Solver_traits(),
NT  lambda = 1000.,
unsigned int  iterations = 50,
NT  tolerance = 1e-6 
)

Default Constructor.

Parameters
border_paramObject that maps the surface's border to the 2D space.
sparse_laTraits object to access a sparse linear system.
lambdaParameter to give importance to shape or angle preservation.
iterationsMaximal number of iterations in the energy minimization process.
toleranceMinimal energy difference between two iterations for the minimization process to continue.

Member Function Documentation

◆ parameterize()

template<class TriangleMesh_ , class BorderParameterizer_ = Default, class SolverTraits_ = Default>
template<typename VertexUVMap , typename VertexIndexMap , typename VertexParameterizedMap >
Error_code CGAL::Surface_mesh_parameterization::ARAP_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::parameterize ( TriangleMesh &  mesh,
halfedge_descriptor  bhd,
VertexUVMap  uvmap,
VertexIndexMap  vimap,
VertexParameterizedMap  vpmap 
)

Compute a 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.

Template Parameters
VertexUVmapmust be a model of ReadWritePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and Point_2 (type deduced from TriangleMesh using Kernel_traits) as value type.
VertexIndexMapmust be a model of ReadablePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and a unique integer as value type.
VertexParameterizedMapmust be a model of ReadWritePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and a Boolean as value type.
Parameters
mesha triangulated surface.
bhda halfedge descriptor on the boundary of mesh.
uvmapan instanciation of the class VertexUVmap.
vimapan instanciation of the class VertexIndexMap.
vpmapan instanciation of the class VertexParameterizedMap.
Precondition
mesh must be a triangular mesh.
The vertices must be indexed (vimap must be initialized).