igl.copyleft.tetgen¶
Python API reference for igl.copyleft.tetgen.
cdt¶
cdt(V: float64[m, n], F: int64[m, n], param: CDTParam = Ellipsis) -> tuple[float64[m, n], int64[m, n], int64[m, n]]
Create a constrained Delaunay tetrahedralization of the convex hull of a mesh.
The input mesh must be non-self-intersecting.
Parameters
V— #V by 3 list of input mesh verticesF— #F by 3 list of input mesh facetsparam— CDTParam struct with fields: use_bounding_box force meshing of the bounding box (default: false) bounding_box_scale scale factor for bounding box (default: 1.01) flags tetgen flags, do not include "c" (default: "Y")
Returns
- tuple (TV, TT, TF): - TV #TV by 3 output vertex positions (input vertices come first) - TT #TT by 4 tetrahedra indices into TV - TF #TF by 3 surface triangle indices (facets from F, possibly subdivided) @raises RuntimeError on failure
mesh_with_skeleton¶
mesh_with_skeleton(V: float64[m, n], F: int64[m, n], C: float64[m, n], P: int64[m] = Ellipsis, BE: int64[m, n] = Ellipsis, CE: int64[m, n] = Ellipsis, samples_per_bone: int = 10, tetgen_flags: str = '') -> tuple[float64[m, n], int64[m, n], int64[m, n]]
Mesh the interior of a surface with a graded tetrahedral mesh conforming to a skeleton.
Parameters
V— #V by 3 list of surface mesh vertex positionsF— #F by 3 list of triangle indicesC— #C by 3 list of skeleton joint positionsP— #P list of point handle indices into C (optional)BE— #BE by 2 list of bone edge indices into C (optional)CE— #CE by 2 list of cage edge indices into P (optional)samples_per_bone— number of samples added per bone (default: 10)tetgen_flags— tetgen option string (default: "" → "pq2Y")
Returns
- tuple (VV, TT, FF): - VV #VV by 3 tet-mesh vertex positions - TT #TT by 4 tetrahedra indices - FF #FF by 3 surface triangle indices @raises RuntimeError on failure
tetrahedralize¶
tetrahedralize(V: float64[m, n], F: int64[m, n] = Ellipsis, H: float64[m, n] = Ellipsis, VM: int64[m] = Ellipsis, FM: int64[m] = Ellipsis, R: float64[m, n] = Ellipsis, flags: str = '') -> tuple[float64[m, n], int64[m, n], int64[m, n], int64[m], int64[m], int64[m, n], int64[m], int64[m, n], int]
Mesh the interior of a surface mesh (V,F) using tetgen
Parameters
V— #V by 3 vertex position listF— #F list of polygon face indices into V (0-indexed)H— #H by 3 list of seed points inside holesVM— #VM list of vertex markersFM— #FM list of face markersR— #R by 5 list of region attributesflags— string 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)TV— #TV by 3 vertex position listTT— #TT by 4 list of tet face indicesTF— #TF by 3 list of triangle face indices ('f', elseboundary_facetsis called on TT)TR— #TT list of region ID for each tetrahedronTN— #TT by 4 list of indices neighbors for each tetrahedron ('n')PT— #TV list of incident tetrahedron for a vertex ('m')FT— #TF by 2 list of tetrahedrons sharing a triface ('nn')num_regions— Number of regions in output mesh