triangle
Python binding to the triangle library
What it is and what it does
Triangle is a Python binding to Jonathan Richard Shewchuk's widely-used C library for two-dimensional mesh generation and Delaunay triangulation. It wraps the C API using Cython to provide direct access to quality mesh refinement, constrained triangulation, and Delaunay computation from Python. The package accepts point sets and polygonal regions as input and produces triangulated meshes suitable for finite-element analysis, computational geometry, and spatial subdivision tasks.
The package depends only on numpy and is available as precompiled wheels across macOS, Linux, and Windows, making installation straightforward. However, the project is dormant—the last release was in January 2025 and there has been no active maintenance beyond repository preservation, so users should expect limited responsiveness to issues or feature requests.
Use it for:
- Generate quality meshes for finite-element simulations by refining point sets and constraining boundaries.
- Compute Delaunay triangulations of scattered point data for spatial analysis and interpolation.
- Triangulate polygonal regions with holes for computational geometry and mesh-based algorithms.
- Subdivide planar domains into triangles for numerical methods and geometric processing.
- Create constrained Delaunay triangulations that respect user-specified edge and region constraints.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Triangle wraps Jonathan Richard Shewchuk's C library to generate two-dimensional quality meshes and compute Delaunay triangulations from point sets or polygonal regions.
Yes, if you need reliable 2D Delaunay triangulation or quality mesh generation: triangle is a mature, well-tested binding to a standard library with no known vulnerabilities and straightforward installation. However, be aware the project is dormant—maintenance is minimal, so plan accordingly if you need active support or encounter bugs. The LGPL-3.0 copyleft license requires careful review if you intend to distribute derivative work.
Install
triangle on PyPI
pip
pip install triangleuv
uv add trianglepoetry
poetry add triangleInstalling triangle
Before you install
Medium install friction: precompiled wheels available across macOS, Linux, and Windows for multiple Python versions, but the package is dormant with no recent maintenance activity beyond the repository remaining open.
License in practice
Licensed under LGPL-3.0 (copyleft): any derivative work or modification must be released under the same license, and linking in a proprietary application may require careful licensing review.
Quickstart
import numpy as np
import triangle
points = np.array([[0, 0], [1, 0], [1, 1], [0, 1]])
A = dict(vertices=points)
B = triangle.triangulate(A, 'p')
print(B['triangles'])
Requires numpy; Python >= 3.7.
Verify before relying
- Whether the wrapped triangle library version and its mesh quality guarantees are documented.
- Performance characteristics and scalability limits for large point sets or complex polygons.
- Active maintenance status: last commit is recent (2025-01-07) but maintenance is marked dormant.
Package facts
| License | LGPL-3.0 (copyleft) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | dormant — 584 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 511,074/month — #6,262 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: triangle-20250106-cp310-cp310-macosx_11_0_arm64.whl; triangle-20250106-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; triangle-20250106-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; triangle-20250106-cp310-cp310-win32.whl; triangle-20250106-cp310-cp310-win_amd64.whl; triangle-20250106-cp311-cp311-macosx_11_0_arm64.whl; triangle-20250106-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; triangle-20250106-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; triangle-20250106-cp311-cp311-win32.whl; triangle-20250106-cp311-cp311-win_amd64.whl; triangle-20250106-cp312-cp312-macosx_11_0_arm64.whl; triangle-20250106-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; triangle-20250106-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; triangle-20250106-cp312-cp312-win32.whl; triangle-20250106-cp312-cp312-win_amd64.whl; triangle-20250106-cp313-cp313-macosx_11_0_arm64.whl; triangle-20250106-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; triangle-20250106-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; triangle-20250106-cp313-cp313-win32.whl; triangle-20250106-cp313-cp313-win_amd64.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
cytriangleCyTriangle wraps Jonathan Shewchuk's Triangle…
copyleft · top 15,000 on PyPI
tetgentetgen wraps the TetGen C++ library to generate…
permissive · top 15,000 on PyPI
mapbox-earcutFast 2D polygon triangulation using the Mapbox…
permissive · top 5,000 on PyPI
cmeel-qhullProvides precompiled qhull binaries (convex…
unclear · top 15,000 on PyPI
trianglesolverSolves for unknown sides and angles of a…
permissive · top 15,000 on PyPI
xatlasGenerates UV texture coordinates for 3D…
permissive · top 15,000 on PyPI
pymeshlabPyMeshLab provides Python bindings to MeshLab,…
copyleft · top 15,000 on PyPI
bermudaProvides Rust-accelerated triangulation…
permissive · top 15,000 on PyPI
manifold3dManifold3d creates and operates on manifold…
permissive · top 5,000 on PyPI
pipablepytorch3dPyTorch3D provides reusable components for 3D…
permissive · top 5,000 on PyPI