Registry / data / tetgen

tetgen

JSON →
library0.8.4pypypi✓ verified 85d ago

Python wrapper for the TetGen tetrahedral mesh generator, providing high-quality tetrahedral meshing of 3D polyhedral domains. Currently at version 0.8.3, with releases approximately every 6-12 months. Part of the PyVista ecosystem.

pip install tetgen
INSTALL
IMPORT
SIG · TETGEN
T
tetgen
datapythonv0.8.4
Install
3.7s avg
Import
375ms
Disk
86MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 3.7s
py 3.11
✕ build_error
✓ 3.6s
py 3.12
✕ build_error
✓ 3.8s
py 3.13
✕ build_error
✓ 3.6s
py 3.9
✕ build_error
✕ build_error
86MB installed
● package 86MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TetGen
from tetgen import TetGen
from tetgen import tetgen
class name is 'TetGen' with capital T and G, not lowercase

Load a surface mesh, create a TetGen instance, tetrahedralize, and access the output mesh.

import pyvista as pv from tetgen import TetGen # Load or create a surface mesh (must be a closed, manifold PolyData) mesh = pv.Sphere() # Initialize TetGen with the surface tet = TetGen(mesh) # Generate tetrahedral mesh (apply attributes/flags as needed) tet.tetrahedralize() # Access the resulting tetrahedral mesh tet_grid = tet.grid print(tet_grid)
Debug
Known issues
breakingIn v0.8.0, the Cython backend was replaced with nanobind. This may cause subtle differences in numerical results and break custom builds.
fix
Upgrade and re-test tetrahedralizations. Avoid relying on Cython-specific behavior.
affects: >=0.8.0
deprecatedMethod compute_cell_quality was renamed to cell_quality in v0.6.7.
fix
Use tet.cell_quality instead of tet.compute_cell_quality.
affects: >=0.6.7
breakingVersion 0.8.3 requires Python >=3.10. No wheels for older Python versions.
fix
Use Python 3.10+.
affects: >=0.8.3
gotchaTetGen expects a closed, manifold surface mesh. Non-manifold or open meshes will fail silently or produce incorrect results.
fix
Clean the input mesh (e.g., with PyVista's clean, merge, or manifold checks) before passing to TetGen.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tetgen'
Package not installed or misspelled.
fix
Run 'pip install tetgen'. Ensure import uses lowercase 'tetgen'.
ImportError: cannot import name 'TetGen' from 'tetgen'
Incorrect import statement; 'TetGen' is the class.
fix
Use 'from tetgen import TetGen'.
RuntimeError: TetGen returned 0 tetrahedra
Input surface mesh is not closed, is non-manifold, or has self-intersections.
fix
Check mesh closure with 'mesh.is_all_manifold' and 'mesh.is_closed'. Repair as needed.
Upgrade
Version history
0.8.4latest on PyPI · released May 4, 2026
Audit
Dependencies
numpyrequiredcore dependency for array operations
pyvistaoptionalrecommended for visualization and mesh handling
Agent activity
16 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
tetgen — pip install tetgen · libregistry