--- id: tetgen version: "0.8.4" license: MIT license_treatment: permissive maintenance: active --- # tetgen — Python interface to tetgen License: permissive · Maintenance: active · Downloads: 105.8K/mo ## 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 above — 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 pip install tetgen uv add tetgen 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_current - Install friction: medium - Maintenance: active - Downloads: 105.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags tetrahedral mesh generation, 3D mesh tetrahedralization, delaunay tetrahedralization python, finite element mesh generation, 3D polyhedral mesh, adaptive mesh refinement, voronoi partition generation, mesh-generation, computational-geometry, finite-element [View on SkillFed](https://skillfed.io/packages/tetgen) · [View on PyPI](https://pypi.org/project/tetgen/)