Developer Documentation
MeshFunctions Namespace Reference

Namespace providing different Mesh editing functions. More...

Functions

template<typename MeshT , typename VectorT >
bool get_boundary (MeshT &_mesh, typename MeshT::VertexHandle _vh, std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &_boundary)
 
template<typename MeshT , typename VectorT >
bool get_boundary (MeshT &_mesh, std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &_boundary)
 
template<typename MeshT , typename VectorT >
void smooth_boundary (MeshT &_mesh, typename MeshT::VertexHandle _vh)
 
template<typename MeshT >
bool neighbour (const MeshT &_mesh, const typename MeshT::FaceHandle &_fh1, const typename MeshT::FaceHandle &_fh2)
 
template<typename MeshT , typename VectorT >
bool cut_face (const VectorT &_porigin, const VectorT &_pnormal, const MeshT &_mesh, const typename MeshT::FaceHandle &_fh)
 
template<typename MeshT >
double calc_area (const MeshT &_mesh)
 
template<typename MeshT >
double calc_angle_around (const MeshT &_mesh, const typename MeshT::VertexHandle &_vh)
 
template<typename MeshT >
void transformMesh (ACG::Matrix4x4d _matrix, MeshT &_mesh)
 
template<typename MeshT >
void transformHandleVertices (ACG::Matrix4x4d _matrix, MeshT &_mesh)
 

Detailed Description

Namespace providing different Mesh editing functions.

Function Documentation

◆ calc_angle_around()

template<typename MeshT >
double MeshFunctions::calc_angle_around ( const MeshT &  _mesh,
const typename MeshT::VertexHandle &  _vh 
)

Get the sum of the angles around a vertex

Parameters
_meshMesh to work on
_vhVertex
Returns
Sum of angles around the vertex

Definition at line 210 of file MeshFunctionsT_impl.hh.

◆ calc_area()

template<typename MeshT >
double MeshFunctions::calc_area ( const MeshT &  _mesh)

Get the area of a mesh ( sum over all triangle areas)

Parameters
_meshMesh to calculate area
Returns
Area spanned by the mesh

Definition at line 192 of file MeshFunctionsT_impl.hh.

◆ cut_face()

template<typename MeshT , typename VectorT >
bool MeshFunctions::cut_face ( const VectorT &  _porigin,
const VectorT &  _pnormal,
const MeshT &  _mesh,
const typename MeshT::FaceHandle &  _fh 
)

Checks if plane cuts the face

Parameters
_poriginPlanes origin
_pnormalPlane normal
_meshMesh
_fhFacehandle of face
Returns
triangle cut by plane?

Definition at line 169 of file MeshFunctionsT_impl.hh.

◆ get_boundary() [1/2]

template<typename MeshT , typename VectorT >
bool MeshFunctions::get_boundary ( MeshT &  _mesh,
typename MeshT::VertexHandle  _vh,
std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &  _boundary 
)

get one boundary at the vertex

Parameters
_meshMesh
_vhVertex handle of one vertex of the boundary
_boundaryCoords and vertex handles of the boundary

Definition at line 76 of file MeshFunctionsT_impl.hh.

◆ get_boundary() [2/2]

template<typename MeshT , typename VectorT >
bool MeshFunctions::get_boundary ( MeshT &  _mesh,
std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &  _boundary 
)

get boundary of a mesh (assumes that there is only one boundary!!

Parameters
_meshMesh
_boundaryCoords and vertex handles of the boundary
Returns
Found a boundary?

Definition at line 115 of file MeshFunctionsT_impl.hh.

◆ neighbour()

template<typename MeshT >
bool MeshFunctions::neighbour ( const MeshT &  _mesh,
const typename MeshT::FaceHandle &  _fh1,
const typename MeshT::FaceHandle &  _fh2 
)

Checks for two faces if they are adjazent

Parameters
_meshMesh
_fh1First Face
_fh2Second Face

Definition at line 156 of file MeshFunctionsT_impl.hh.

◆ smooth_boundary()

template<typename MeshT , typename VectorT >
void MeshFunctions::smooth_boundary ( MeshT &  _mesh,
typename MeshT::VertexHandle  _vh 
)

function to smooth a boundary of a given mesh by moving each vertex to the mean Position of its adjazent verticies

Parameters
_meshMesh to work on
_vhVertex handle on the boundary

Definition at line 139 of file MeshFunctionsT_impl.hh.

◆ transformHandleVertices()

template<typename MeshT >
void MeshFunctions::transformHandleVertices ( ACG::Matrix4x4d  _matrix,
MeshT &  _mesh 
)

Transform handle vertices only

Parameters
_matrixThe transformation matrix
_meshThe mesh that is to be transformed

Definition at line 269 of file MeshFunctionsT_impl.hh.

◆ transformMesh()

template<typename MeshT >
void MeshFunctions::transformMesh ( ACG::Matrix4x4d  _matrix,
MeshT &  _mesh 
)

Transform geometry of the mesh using the specified transformation matrix.

Parameters
_matrixThe transformation matrix
_meshThe mesh that is to be transformed

Definition at line 231 of file MeshFunctionsT_impl.hh.