Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Basic functions used by global surface parameterization algorithms (PGP, QuadCover). More...
#include <geogram/basic/common.h>
#include <geogram/basic/attributes.h>
#include <geogram/basic/geometry.h>
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... | |
Basic functions used by global surface parameterization algorithms (PGP, QuadCover).
Definition in file mesh_global_param.h.
Brushes the direction field.
Makes the field rotation between adjacent facets equal to zero over a covering tree of the surface.
[in] | mesh | a pointer to a surface mesh |
[in,out] | B | a facet attribute with the guidance vector field one 3d vector per facet). |
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.
[in] | mesh | a pointer to a surface mesh |
[in] | B | a vec3 attribute attached to the facets |
[out] | R_ff | an index_t attribute attached to facet corners, in 0,1,2,3 |
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.
[in] | mesh | a pointer to a surface mesh |
[in] | R_ff | an index_t attribute attached to facet corners, computed by compute_R_ff(). |
[out] | R_fv | an index_t attribute attached to facet corners, in 0,1,2,3 |
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.
[in] | mesh | a pointer to a surface mesh |
[in] | R_ff | the 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_border | a facet corner attribute that contains 1 if the halfede edge is on the border of the ball, 0 otherwise |
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).
[in] | mesh | a pointer to a surface mesh |
[out] | c_on_border | a facet corner attribute that contains 1 if the halfede edge is on the border of the ball, 0 otherwise |
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.
[in] | mesh | a pointer to a surface mesh. |
[out] | B | a facet attribute with the computed frame field. |
[in] | hard_angle_threshold | edges with a facet angle larger than this threshold are fixed as constraints for the frame field. |
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.
[in] | mesh | a pointer to a surface mesh. |
[in,out] | B | a facet attribute with the guidance vector field, one 3d vector per facet). |
[in] | R_ff | the 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] | f | a mesh facet. |
[in] | c | a corner of facet p f. |
[out] | Bc | the field along the edge originated from corner c of facet f . |
[out] | BTc | the orthogonal field along the edge originated from corner c of facet f . |
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.
[in] | mesh | a pointer to a surface mesh. |
[in,out] | B | a facet attribute with the guidance vector field, one 3d vector per facet). |
[in] | R_ff | the 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] | constraint | for each corner, a binary-or combination of CNSTR_U and CNSTR_V. |
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
.
[in] | mesh | a pointer to a surface mesh. |
[in] | c | a corner incident to the edge. |
[in,out] | B | a facet attribute with the guidance vector field one 3d vector per facet). |
index_t GEO::GlobalParam2d::Internal::inverse_R | ( | index_t | R | ) |
Gets the inverse of a rotation.
[in] | R | the rotation in angus (in 0,1,2,3) |
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.
[in] | mesh | a pointer to a surface mesh |
[in] | R_ff | the 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_singular | a vertex attribute that indicates for each vertex whether it is singular. |
void GEO::GlobalParam2d::Internal::snap_tex_coord | ( | double & | coord | ) |
Snaps a texture coordinate.
This is required by the mesh extraction algorithm.
[in,out] | coord | the coordinate to be snapped. |
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.
[in] | mesh | a pointer to a surface mesh. |
[in] | B | a facet attribute with the guidance vector field one 3d vector per facet). |
[out] | Bv | a vertex attribute with the guidance vector field one 3d vector per vertex). |
[in] | R_fv | the 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(). |