libigl v2.5.0
Loading...
Searching...
No Matches
igl::copyleft::tetgen Namespace Reference

Classes

struct  CDTParam
 Parameters for controling the CDT. More...

Functions

template<typename DerivedV, typename DerivedF, typename DerivedTV, typename DerivedTT, typename DerivedTF>
bool cdt (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const CDTParam &param, Eigen::PlainObjectBase< DerivedTV > &TV, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTF > &TF)
 Create a constrained delaunay tessellation containing convex hull of the given non-selfintersecting mesh.
template<typename DerivedV, typename DerivedF, typename DerivedH, typename DerivedVM, typename DerivedFM, typename DerivedR>
void mesh_to_tetgenio (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedH > &H, const Eigen::MatrixBase< DerivedVM > &VM, const Eigen::MatrixBase< DerivedFM > &FM, const Eigen::MatrixBase< DerivedR > &R, tetgenio &in)
 Load a vertex list and face list into a tetgenio object.
bool mesh_with_skeleton (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &C, const Eigen::VectorXi &, const Eigen::MatrixXi &BE, const Eigen::MatrixXi &CE, const int samples_per_bone, const std::string &tetgen_flags, Eigen::MatrixXd &VV, Eigen::MatrixXi &TT, Eigen::MatrixXi &FF)
 Mesh the interior of a given surface with tetrahedra which are graded (tend to be small near the surface and large inside) and conform to the given handles and samplings thereof.
bool mesh_with_skeleton (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &C, const Eigen::VectorXi &, const Eigen::MatrixXi &BE, const Eigen::MatrixXi &CE, const int samples_per_bone, Eigen::MatrixXd &VV, Eigen::MatrixXi &TT, Eigen::MatrixXi &FF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename DerivedV, typename DerivedT, typename DerivedF, typename DerivedTM, typename DerivedR, typename DerivedN, typename DerivedPT, typename DerivedFT>
bool tetgenio_to_tetmesh (const tetgenio &out, Eigen::PlainObjectBase< DerivedV > &V, Eigen::PlainObjectBase< DerivedT > &T, Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedTM > &TM, Eigen::PlainObjectBase< DerivedR > &R, Eigen::PlainObjectBase< DerivedN > &N, Eigen::PlainObjectBase< DerivedPT > &PT, Eigen::PlainObjectBase< DerivedFT > &FT, int &num_regions)
 Convert a tetgenio to a tetmesh.
template<typename DerivedV, typename DerivedF, typename DerivedH, typename DerivedVM, typename DerivedFM, typename DerivedR, typename DerivedTV, typename DerivedTT, typename DerivedTF, typename DerivedTM, typename DerivedTR, typename DerivedTN, typename DerivedPT, typename DerivedFT>
int tetrahedralize (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedH > &H, const Eigen::MatrixBase< DerivedVM > &VM, const Eigen::MatrixBase< DerivedFM > &FM, const Eigen::MatrixBase< DerivedR > &R, const std::string switches, Eigen::PlainObjectBase< DerivedTV > &TV, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTF > &TF, Eigen::PlainObjectBase< DerivedTM > &TM, Eigen::PlainObjectBase< DerivedTR > &TR, Eigen::PlainObjectBase< DerivedTN > &TN, Eigen::PlainObjectBase< DerivedPT > &PT, Eigen::PlainObjectBase< DerivedFT > &FT, int &num_regions)
 Mesh the interior of a surface mesh (V,F) using tetgen.
template<typename DerivedV, typename DerivedF, typename DerivedTV, typename DerivedTT, typename DerivedTF>
int tetrahedralize (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const std::string switches, Eigen::PlainObjectBase< DerivedTV > &TV, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTF > &TF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Function Documentation

◆ cdt()

template<typename DerivedV, typename DerivedF, typename DerivedTV, typename DerivedTT, typename DerivedTF>
bool igl::copyleft::tetgen::cdt ( const Eigen::MatrixBase< DerivedV > & V,
const Eigen::MatrixBase< DerivedF > & F,
const CDTParam & param,
Eigen::PlainObjectBase< DerivedTV > & TV,
Eigen::PlainObjectBase< DerivedTT > & TT,
Eigen::PlainObjectBase< DerivedTF > & TF )

Create a constrained delaunay tessellation containing convex hull of the given non-selfintersecting mesh.

Parameters
[in]V#V by 3 list of input mesh vertices
[in]F#F by 3 list of input mesh facets
[in]paramsee above
[out]TV#TV by 3 list of output mesh vertices (V come first)
[out]TT#TT by 3 list of tetrahedra indices into TV.
[out]TF#TF by 3 list of facets from F potentially subdivided.

◆ mesh_to_tetgenio()

template<typename DerivedV, typename DerivedF, typename DerivedH, typename DerivedVM, typename DerivedFM, typename DerivedR>
void igl::copyleft::tetgen::mesh_to_tetgenio ( const Eigen::MatrixBase< DerivedV > & V,
const Eigen::MatrixBase< DerivedF > & F,
const Eigen::MatrixBase< DerivedH > & H,
const Eigen::MatrixBase< DerivedVM > & VM,
const Eigen::MatrixBase< DerivedFM > & FM,
const Eigen::MatrixBase< DerivedR > & R,
tetgenio & in )

Load a vertex list and face list into a tetgenio object.

Parameters
[in]V#V by 3 vertex position list
[in]F#F list of polygon face indices into V (0-indexed)
[out]intetgenio input object
[out]H#H list of seed point inside each hole
[out]R#R list of seed point inside each region

◆ mesh_with_skeleton() [1/2]

bool igl::copyleft::tetgen::mesh_with_skeleton ( const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::MatrixXd & C,
const Eigen::VectorXi & ,
const Eigen::MatrixXi & BE,
const Eigen::MatrixXi & CE,
const int samples_per_bone,
const std::string & tetgen_flags,
Eigen::MatrixXd & VV,
Eigen::MatrixXi & TT,
Eigen::MatrixXi & FF )

Mesh the interior of a given surface with tetrahedra which are graded (tend to be small near the surface and large inside) and conform to the given handles and samplings thereof.

Parameters
[in]V#V by 3 list of mesh vertex positions
[in]F#F by 3 list of triangle indices
[in]C#C by 3 list of vertex positions
[in]P#P list of point handle indices
[in]BE#BE by 2 list of bone-edge indices
[in]CE#CE by 2 list of cage-edge indices
[in]samples_per_bone#samples to add per bone
[in]tetgen_flagsflags to pass to tetgen {""-->"pq2Y"} otherwise you're on your own and it's your funeral if you pass nonsense flags
[out]VV#VV by 3 list of tet-mesh vertex positions
[out]TT#TT by 4 list of tetrahedra indices
[out]FF#FF by 3 list of surface triangle indices
Returns
true only on success

◆ mesh_with_skeleton() [2/2]

bool igl::copyleft::tetgen::mesh_with_skeleton ( const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::MatrixXd & C,
const Eigen::VectorXi & ,
const Eigen::MatrixXi & BE,
const Eigen::MatrixXi & CE,
const int samples_per_bone,
Eigen::MatrixXd & VV,
Eigen::MatrixXi & TT,
Eigen::MatrixXi & FF )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ tetgenio_to_tetmesh()

template<typename DerivedV, typename DerivedT, typename DerivedF, typename DerivedTM, typename DerivedR, typename DerivedN, typename DerivedPT, typename DerivedFT>
bool igl::copyleft::tetgen::tetgenio_to_tetmesh ( const tetgenio & out,
Eigen::PlainObjectBase< DerivedV > & V,
Eigen::PlainObjectBase< DerivedT > & T,
Eigen::PlainObjectBase< DerivedF > & F,
Eigen::PlainObjectBase< DerivedTM > & TM,
Eigen::PlainObjectBase< DerivedR > & R,
Eigen::PlainObjectBase< DerivedN > & N,
Eigen::PlainObjectBase< DerivedPT > & PT,
Eigen::PlainObjectBase< DerivedFT > & FT,
int & num_regions )

Convert a tetgenio to a tetmesh.

Parameters
[in]outoutput of tetrahedralization
[out]V#V by 3 list of mesh vertex positions
[out]T#T by 4 list of mesh tet indices into V
[out]F#F by 3 list of mesh triangle indices into V
[out]TM#T by 1 list of material indices into R
[out]R#TT list of region ID for each tetrahedron
[out]N#TT by 4 list of indices neighbors for each tetrahedron ('n')
[out]PT#TV list of incident tetrahedron for a vertex ('m')
[out]FT#TF by 2 list of tetrahedrons sharing a triface ('nn')
[out]num_regionsNumber of regions in output mesh

◆ tetrahedralize() [1/2]

template<typename DerivedV, typename DerivedF, typename DerivedH, typename DerivedVM, typename DerivedFM, typename DerivedR, typename DerivedTV, typename DerivedTT, typename DerivedTF, typename DerivedTM, typename DerivedTR, typename DerivedTN, typename DerivedPT, typename DerivedFT>
int igl::copyleft::tetgen::tetrahedralize ( const Eigen::MatrixBase< DerivedV > & V,
const Eigen::MatrixBase< DerivedF > & F,
const Eigen::MatrixBase< DerivedH > & H,
const Eigen::MatrixBase< DerivedVM > & VM,
const Eigen::MatrixBase< DerivedFM > & FM,
const Eigen::MatrixBase< DerivedR > & R,
const std::string switches,
Eigen::PlainObjectBase< DerivedTV > & TV,
Eigen::PlainObjectBase< DerivedTT > & TT,
Eigen::PlainObjectBase< DerivedTF > & TF,
Eigen::PlainObjectBase< DerivedTM > & TM,
Eigen::PlainObjectBase< DerivedTR > & TR,
Eigen::PlainObjectBase< DerivedTN > & TN,
Eigen::PlainObjectBase< DerivedPT > & PT,
Eigen::PlainObjectBase< DerivedFT > & FT,
int & num_regions )

Mesh the interior of a surface mesh (V,F) using tetgen.

Parameters
[in]V#V by 3 vertex position list
[in]F#F list of polygon face indices into V (0-indexed)
[in]H#H by 3 list of seed points inside holes
[in]VM#VM list of vertex markers
[in]FM#FM list of face markers
[in]R#R by 5 list of region attributes
[in]switchesstring of tetgen options (See tetgen documentation) e.g. "pq1.414a0.01" tries to mesh the interior of a given surface with quality and area constraints "" will mesh the convex hull constrained to pass through V (ignores F)
[out]TV#TV by 3 vertex position list
[out]TT#TT by 4 list of tet face indices
[out]TF#TF by 3 list of triangle face indices ('f', else boundary_facets is called on TT)
[out]TR#TT list of region ID for each tetrahedron
[out]TN#TT by 4 list of indices neighbors for each tetrahedron ('n')
[out]PT#TV list of incident tetrahedron for a vertex ('m')
[out]FT#TF by 2 list of tetrahedrons sharing a triface ('nn')
[out]num_regionsNumber of regions in output mesh
Returns
status: 0 success 1 tetgen threw exception 2 tetgen did not crash but could not create any tets (probably there are holes, duplicate faces etc.) -1 other error
Note
The polygons F can contain polygons with different number of vertices. Trailing unused columns are filled with -1. For example, triangles and segments can be specified using a #F x 3 matrix: for segments the third column contains -1.
Tetgen mixes integer region ids in with other region data attr = (int) in->regionlist[i + 3];. So it's declared safe to use integer types for TR since this also assumes that there's a single tet attribute and that it's the region id.

Example

Eigen::MatrixXd V;
Eigen::MatrixXi F;
Eigen::VectorXi VM,FM;
Eigen::MatrixXd H,R;
Eigen::VectorXi TM,TR,PT;
Eigen::MatrixXi FT,TN;
int numRegions;
tetrahedralize(V,F,H,VM,FM,R,switches,TV,TT,TF,TM,TR,TN,PT,FT,numRegions);
int tetrahedralize(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedH > &H, const Eigen::MatrixBase< DerivedVM > &VM, const Eigen::MatrixBase< DerivedFM > &FM, const Eigen::MatrixBase< DerivedR > &R, const std::string switches, Eigen::PlainObjectBase< DerivedTV > &TV, Eigen::PlainObjectBase< DerivedTT > &TT, Eigen::PlainObjectBase< DerivedTF > &TF, Eigen::PlainObjectBase< DerivedTM > &TM, Eigen::PlainObjectBase< DerivedTR > &TR, Eigen::PlainObjectBase< DerivedTN > &TN, Eigen::PlainObjectBase< DerivedPT > &PT, Eigen::PlainObjectBase< DerivedFT > &FT, int &num_regions)
Mesh the interior of a surface mesh (V,F) using tetgen.

◆ tetrahedralize() [2/2]

template<typename DerivedV, typename DerivedF, typename DerivedTV, typename DerivedTT, typename DerivedTF>
int igl::copyleft::tetgen::tetrahedralize ( const Eigen::MatrixBase< DerivedV > & V,
const Eigen::MatrixBase< DerivedF > & F,
const std::string switches,
Eigen::PlainObjectBase< DerivedTV > & TV,
Eigen::PlainObjectBase< DerivedTT > & TT,
Eigen::PlainObjectBase< DerivedTF > & TF )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.