Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
mesh_global_param.h File Reference

Basic functions used by global surface parameterization algorithms (PGP, QuadCover). More...

Go to the source code of this file.

Namespaces

 GEO
 Global Vorpaline namespace.
 

Enumerations

enum  { CNSTR_NONE = 0 , CNSTR_U = 1 , CNSTR_V = 2 }
 

Functions

void GEO::GlobalParam2d::frame_field (Mesh *mesh, Attribute< vec3 > &B, double hard_angle_threshold=45.0)
 Computes a guidance frame field for global parameterization. More...
 
void GEO::GlobalParam2d::Internal::compute_R_ff (Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff)
 Computes for each pair of adjacent facets the number of times the facet vector B should be rotated along the facet normal to minimize its angle with the vector B of the adjacent facet. More...
 
void GEO::GlobalParam2d::Internal::compute_R_fv (Mesh *mesh, Attribute< index_t > &R_ff, Attribute< index_t > &R_fv)
 Computes for each facet corner the number of times the facet vector B should be rotated along the facet normal to minimize its angle with the vector B of a reference facet attached to each vertex. More...
 
void GEO::GlobalParam2d::Internal::mark_singular_vertices (Mesh *mesh, Attribute< index_t > &R_ff, Attribute< bool > &v_is_singular)
 Marks the singular vertices of the direction field. More...
 
void GEO::GlobalParam2d::Internal::brush (Mesh *mesh, Attribute< vec3 > &B)
 Brushes the direction field. More...
 
void GEO::GlobalParam2d::Internal::do_the_ball (Mesh *mesh, Attribute< index_t > &R_ff, Attribute< index_t > &c_on_border)
 Computes the border of the ball. More...
 
void GEO::GlobalParam2d::Internal::do_the_ball_no_brush_no_zip (Mesh *mesh, Attribute< index_t > &c_on_border)
 Computes the border of the ball. More...
 
void GEO::GlobalParam2d::Internal::get_B_on_edge (Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff, index_t f, index_t c, vec3 &Bc, vec3 &BTc)
 Gets the field B evaluated at a given mesh edge. More...
 
void GEO::GlobalParam2d::Internal::get_constraints (Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff, Attribute< index_t > &constraint)
 Determines the constraints for all edges of the mesh. More...
 
index_t GEO::GlobalParam2d::Internal::get_edge_constraints (Mesh *mesh, index_t c, Attribute< vec3 > &B)
 Tests whether U and V are constrained for a given edge. More...
 
index_t GEO::GlobalParam2d::Internal::inverse_R (index_t R)
 Gets the inverse of a rotation. More...
 
void GEO::GlobalParam2d::Internal::snap_tex_coord (double &coord)
 Snaps a texture coordinate. More...
 
void GEO::GlobalParam2d::Internal::transfer_B_to_vertices (Mesh *mesh, Attribute< vec3 > &B, Attribute< vec3 > &Bv, Attribute< index_t > &R_fv)
 Transfers a facet vector field to a vertex vector field. More...
 

Detailed Description

Basic functions used by global surface parameterization algorithms (PGP, QuadCover).

Definition in file mesh_global_param.h.

Function Documentation

◆ brush()

void GEO::GlobalParam2d::Internal::brush ( Mesh mesh,
Attribute< vec3 > &  B 
)

Brushes the direction field.

Makes the field rotation between adjacent facets equal to zero over a covering tree of the surface.

Parameters
[in]mesha pointer to a surface mesh
[in,out]Ba facet attribute with the guidance vector field one 3d vector per facet).

◆ compute_R_ff()

void GEO::GlobalParam2d::Internal::compute_R_ff ( Mesh mesh,
Attribute< vec3 > &  B,
Attribute< index_t > &  R_ff 
)

Computes for each pair of adjacent facets the number of times the facet vector B should be rotated along the facet normal to minimize its angle with the vector B of the adjacent facet.

Parameters
[in]mesha pointer to a surface mesh
[in]Ba vec3 attribute attached to the facets
[out]R_ffan index_t attribute attached to facet corners, in 0,1,2,3

◆ compute_R_fv()

void GEO::GlobalParam2d::Internal::compute_R_fv ( Mesh mesh,
Attribute< index_t > &  R_ff,
Attribute< index_t > &  R_fv 
)

Computes for each facet corner the number of times the facet vector B should be rotated along the facet normal to minimize its angle with the vector B of a reference facet attached to each vertex.

Parameters
[in]mesha pointer to a surface mesh
[in]R_ffan index_t attribute attached to facet corners, computed by compute_R_ff().
[out]R_fvan index_t attribute attached to facet corners, in 0,1,2,3

◆ do_the_ball()

void GEO::GlobalParam2d::Internal::do_the_ball ( Mesh mesh,
Attribute< index_t > &  R_ff,
Attribute< index_t > &  c_on_border 
)

Computes the border of the ball.

Parameters
[in]mesha pointer to a surface mesh
[in]R_ffthe Rij corner attribute indicating how many times the vector associated with facet j should be rotated by 90 degrees around its facet normal to match the vector associated with facet i. It is computed by compute_R_ff().
[out]c_on_bordera facet corner attribute that contains 1 if the halfede edge is on the border of the ball, 0 otherwise

◆ do_the_ball_no_brush_no_zip()

void GEO::GlobalParam2d::Internal::do_the_ball_no_brush_no_zip ( Mesh mesh,
Attribute< index_t > &  c_on_border 
)

Computes the border of the ball.

This version does not suppose that the B's are brushed and only computes the facet covering tree (no zipping).

Parameters
[in]mesha pointer to a surface mesh
[out]c_on_bordera facet corner attribute that contains 1 if the halfede edge is on the border of the ball, 0 otherwise

◆ frame_field()

void GEO::GlobalParam2d::frame_field ( Mesh mesh,
Attribute< vec3 > &  B,
double  hard_angle_threshold = 45.0 
)

Computes a guidance frame field for global parameterization.

Creates the vector field in the "B" facet attribute, of type vec3.

Parameters
[in]mesha pointer to a surface mesh.
[out]Ba facet attribute with the computed frame field.
[in]hard_angle_thresholdedges with a facet angle larger than this threshold are fixed as constraints for the frame field.

◆ get_B_on_edge()

void GEO::GlobalParam2d::Internal::get_B_on_edge ( Mesh mesh,
Attribute< vec3 > &  B,
Attribute< index_t > &  R_ff,
index_t  f,
index_t  c,
vec3 Bc,
vec3 BTc 
)

Gets the field B evaluated at a given mesh edge.

If the edge is incident to two facets, then the field is averaged.

Parameters
[in]mesha pointer to a surface mesh.
[in,out]Ba facet attribute with the guidance vector field, one 3d vector per facet).
[in]R_ffthe Rij corner attribute indicating how many times the vector associated with facet j should be rotated by 90 degrees around its facet normal to match the vector associated with facet i. It is computed by compute_R_ff().
[in]fa mesh facet.
[in]ca corner of facet p f.
[out]Bcthe field along the edge originated from corner c of facet f.
[out]BTcthe orthogonal field along the edge originated from corner c of facet f.

◆ get_constraints()

void GEO::GlobalParam2d::Internal::get_constraints ( Mesh mesh,
Attribute< vec3 > &  B,
Attribute< index_t > &  R_ff,
Attribute< index_t > &  constraint 
)

Determines the constraints for all edges of the mesh.

Parameters
[in]mesha pointer to a surface mesh.
[in,out]Ba facet attribute with the guidance vector field, one 3d vector per facet).
[in]R_ffthe Rij corner attribute indicating how many times the vector associated with facet j should be rotated by 90 degrees around its facet normal to match the vector associated with facet i. It is computed by compute_R_ff().
[out]constraintfor each corner, a binary-or combination of CNSTR_U and CNSTR_V.

◆ get_edge_constraints()

index_t GEO::GlobalParam2d::Internal::get_edge_constraints ( Mesh mesh,
index_t  c,
Attribute< vec3 > &  B 
)

Tests whether U and V are constrained for a given edge.

An edge is constrained if it is a border edge or if it is sharp. The coordinate that is constrained is determined from the dot product betwee the edge vector and B.

Parameters
[in]mesha pointer to a surface mesh.
[in]ca corner incident to the edge.
[in,out]Ba facet attribute with the guidance vector field one 3d vector per facet).
Returns
One of CNSTR_U, CNSTR_V, CNSTR_U | CNSTR_V.

◆ inverse_R()

index_t GEO::GlobalParam2d::Internal::inverse_R ( index_t  R)

Gets the inverse of a rotation.

Parameters
[in]Rthe rotation in angus (in 0,1,2,3)
Returns
the inverse of R in angus (in 0,1,2,3)

◆ mark_singular_vertices()

void GEO::GlobalParam2d::Internal::mark_singular_vertices ( Mesh mesh,
Attribute< index_t > &  R_ff,
Attribute< bool > &  v_is_singular 
)

Marks the singular vertices of the direction field.

Parameters
[in]mesha pointer to a surface mesh
[in]R_ffthe Rij corner attribute indicating how many times the vector associated with facet j should be rotated by 90 degrees around its facet normal to match the vector associated with facet i. It is computed by compute_R_ff().
[out]v_is_singulara vertex attribute that indicates for each vertex whether it is singular.

◆ snap_tex_coord()

void GEO::GlobalParam2d::Internal::snap_tex_coord ( double &  coord)

Snaps a texture coordinate.

This is required by the mesh extraction algorithm.

Parameters
[in,out]coordthe coordinate to be snapped.

◆ transfer_B_to_vertices()

void GEO::GlobalParam2d::Internal::transfer_B_to_vertices ( Mesh mesh,
Attribute< vec3 > &  B,
Attribute< vec3 > &  Bv,
Attribute< index_t > &  R_fv 
)

Transfers a facet vector field to a vertex vector field.

Parameters
[in]mesha pointer to a surface mesh.
[in]Ba facet attribute with the guidance vector field one 3d vector per facet).
[out]Bva vertex attribute with the guidance vector field one 3d vector per vertex).
[in]R_fvthe Rij corner attribute indicating how many times the vector associated with facet j should be rotated by 90 degrees around its facet normal to match the vector attached to the vertex. It is computed by compute_R_fv().