skillfed

tetgen

Python interface to tetgen

tetgen v0.8.4 105.8K downloads/30d#12,676 on PyPI310
Permissive license MIT Active released

What it is and what it does

tetgen is a Python wrapper around the TetGen C++ software for generating tetrahedral meshes of 3D polyhedral domains. It combines the speed of compiled C++ with Python's ease of use. The underlying TetGen engine (version 1.6.0) produces exact constrained Delaunay tetrahedralizations, boundary-conforming Delaunay meshes, and Voronoi partitions—all suitable for numerical methods like finite element or finite volume analysis.

Typical workflows involve passing a triangular surface mesh to tetgen, specifying quality constraints (dihedral angles, aspect ratios), and optionally using a background mesh to define spatially varying element sizes for adaptive refinement. The result is a tetrahedral grid that can be analyzed or exported for downstream simulation. The package supports Python 3.10 through 3.14 and depends only on numpy.

Use it for:

  • Generate tetrahedral meshes from surface geometries for finite element simulations in structural mechanics or fluid dynamics.
  • Create adaptive meshes with finer elements near regions of interest using background mesh sizing functions.
  • Produce Voronoi partitions for spatial analysis or computational geometry tasks.
  • Refine existing meshes to meet quality constraints (minimum dihedral angles, aspect ratios) for numerical stability.
  • Process manifold triangular surfaces into tetrahedral grids for numerical analysis workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

tetgen wraps the TetGen C++ library to generate tetrahedral meshes from 3D polyhedral domains, producing constrained Delaunay tetrahedralizations and Voronoi partitions suitable for finite element and finite volume methods.

Yes, if you need tetrahedral mesh generation for scientific computing. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers pre-built wheels that minimize installation friction. The single runtime dependency (numpy) is standard. Install only if you actually work with 3D mesh generation; it is not a general-purpose utility.

Install

tetgen on PyPI

pip

pip install tetgen

uv

uv add tetgen

poetry

poetry add tetgen

Installing tetgen

Before you install

Medium install friction due to compiled C++ bindings, but mitigated by pre-built wheels for Python 3.10–3.14 across macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows. Actively maintained with recent releases and no known vulnerabilities.

License in practice

MIT license permits commercial and private use with minimal restrictions; attribution required but no copyleft obligations.

Quickstart

pip install tetgen

import tetgen
import numpy as np

tet = tetgen.TetGen(surface_mesh)
tet.tetrahedralize(order=1, mindihedral=20, minratio=1.5)
grid = tet.grid

Requires Python 3.10 or later; numpy is a runtime dependency.

Verify before relying

  • Whether background mesh sizing functions support arbitrary user-defined criteria beyond proximity-based refinement.
  • Performance characteristics and scalability limits for very large or complex polyhedral domains.
  • Availability of detailed error handling and diagnostic output when mesh generation fails.
  • Integration capabilities with visualization tools beyond what the fact sheet explicitly states.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 102 days since the last release
Last repo commit
First released
Downloads 105,840/month — #12,676 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tetgen-0.8.4-cp310-cp310-macosx_10_14_x86_64.whl; tetgen-0.8.4-cp310-cp310-macosx_11_0_arm64.whl; tetgen-0.8.4-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; tetgen-0.8.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tetgen-0.8.4-cp310-cp310-win_amd64.whl; tetgen-0.8.4-cp311-cp311-macosx_10_14_x86_64.whl; tetgen-0.8.4-cp311-cp311-macosx_11_0_arm64.whl; tetgen-0.8.4-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; tetgen-0.8.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tetgen-0.8.4-cp311-cp311-win_amd64.whl; tetgen-0.8.4-cp312-abi3-macosx_10_14_x86_64.whl; tetgen-0.8.4-cp312-abi3-macosx_11_0_arm64.whl; tetgen-0.8.4-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; tetgen-0.8.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; tetgen-0.8.4-cp312-abi3-win_amd64.whl

Intended Audience :: Science/ResearchOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

tetrahedral mesh generation3D mesh tetrahedralizationdelaunay tetrahedralization pythonfinite element mesh generation3D polyhedral meshadaptive mesh refinementvoronoi partition generation
mesh-generationcomputational-geometryfinite-element

More Mathematics packages