Skip to content

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 vertices
  • F — #F by 3 list of input mesh facets
  • param — 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

C++ reference

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 positions
  • F — #F by 3 list of triangle indices
  • C — #C by 3 list of skeleton joint positions
  • P — #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

C++ reference

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 list
  • F — #F list of polygon face indices into V (0-indexed)
  • H — #H by 3 list of seed points inside holes
  • VM — #VM list of vertex markers
  • FM — #FM list of face markers
  • R — #R by 5 list of region attributes
  • flags — 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 list
  • TT — #TT by 4 list of tet face indices
  • TF — #TF by 3 list of triangle face indices ('f', else boundary_facets is called on TT)
  • TR — #TT list of region ID for each tetrahedron
  • TN — #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

CDTParam

CDTParam.use_bounding_box

use_bounding_box() -> bool

CDTParam.use_bounding_box

use_bounding_box() -> None

CDTParam.bounding_box_scale

bounding_box_scale() -> float

CDTParam.bounding_box_scale

bounding_box_scale() -> None

CDTParam.flags

flags() -> str

CDTParam.flags

flags() -> None