mapbox-earcut
Python bindings for the mapbox earcut C++ polygon triangulation library
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, permissively licensed, has no known vulnerabilities, and solves a specific computational geometry problem efficiently. Install it if you need fast, robust polygon triangulation with holes support; skip it if you only work with simple convex polygons or have no triangulation requirement.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires numpy; input vertices must be a 2D array and rings array must specify end-indices for each polygon ring.
- Medium install friction due to compiled wheels, but well-supported across Python 3.9–3.14 and multiple platforms (macOS, Linux, Windows, ARM).
- Active maintenance with recent commits.
License · maintenance · safety
permissive license (permissive) — ISC License (permissive) allows commercial and private use with minimal restrictions.
last release 2025-11-16 (271 days) · last repo commit 2026-08-10 · 40 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,071,615 downloads/mo, #2,767 on PyPI
Alternatives
Verify before relying
import mapbox_earcut as earcut
import numpy as np
verts = np.array([[0, 0], [1, 0], [1, 1]]).reshape(-1, 2)
rings = np.array([3])
result = earcut.triangulate_float32(verts, rings)- Whether the library's robustness claims (handling degeneracies and self-intersections) are validated by test coverage or real-world usage reports.
- Performance benchmarks compared to other triangulation libraries for typical polygon sizes.
What it is and what it does
mapbox_earcut is a Python wrapper around the C++ Mapbox Earcut library, a fast polygon triangulation engine. It takes a 2D polygon (with optional holes) and returns triangle indices that decompose the polygon into a mesh. The algorithm uses z-order curve hashing to optimize performance and is designed to handle practical geographic and geometric data that may contain holes, twisted edges, or self-intersections—though it does not guarantee mathematically perfect results in all edge cases, only acceptable practical outcomes.
The package exposes four type-specific triangulation functions (float32, float64, int32, int64) to match your vertex data type, and depends only on numpy. It supports Python 3.9 through 3.14 with prebuilt wheels for most common platforms, making installation straightforward despite the compiled C++ backend.
Use it for
- Triangulate geographic boundaries (country borders, city limits) for rendering or spatial analysis.
- Convert complex 2D shapes with holes into triangle meshes for graphics rendering or physics simulation.
- Decompose architectural floor plans or CAD drawings into triangles for computational geometry operations.
- Prepare polygon data for WebGL or other graphics pipelines that require triangle primitives.
- Batch-process large sets of polygons in geospatial or mapping applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, permissively licensed, has no known vulnerabilities, and solves a specific computational geometry problem efficiently. Install it if you need fast, robust polygon triangulation with holes support; skip it if you only work with simple convex polygons or have no triangulation requirement.
Install
mapbox-earcut on PyPI
Before you install
Medium install friction due to compiled wheels, but well-supported across Python 3.9–3.14 and multiple platforms (macOS, Linux, Windows, ARM). Active maintenance with recent commits.
Requires numpy; input vertices must be a 2D array and rings array must specify end-indices for each polygon ring.
License in practice
ISC License (permissive) allows commercial and private use with minimal restrictions.
Quickstart
import mapbox_earcut as earcut
import numpy as np
verts = np.array([[0, 0], [1, 0], [1, 1]]).reshape(-1, 2)
rings = np.array([3])
result = earcut.triangulate_float32(verts, rings)
Verify before relying
- Whether the library's robustness claims (handling degeneracies and self-intersections) are validated by test coverage or real-world usage reports.
- Performance benchmarks compared to other triangulation libraries for typical polygon sizes.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 271 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,071,615 / month, #2,767 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Programming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 1 - Unstable |
Evidence: mapbox_earcut-2.0.0-cp310-cp310-macosx_10_13_x86_64.whl; mapbox_earcut-2.0.0-cp310-cp310-macosx_11_0_arm64.whl; mapbox_earcut-2.0.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mapbox_earcut-2.0.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mapbox_earcut-2.0.0-cp310-cp310-musllinux_1_2_aarch64.whl; mapbox_earcut-2.0.0-cp310-cp310-musllinux_1_2_x86_64.whl; mapbox_earcut-2.0.0-cp310-cp310-win32.whl; mapbox_earcut-2.0.0-cp310-cp310-win_amd64.whl; mapbox_earcut-2.0.0-cp311-cp311-macosx_10_13_x86_64.whl; mapbox_earcut-2.0.0-cp311-cp311-macosx_11_0_arm64.whl; mapbox_earcut-2.0.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; mapbox_earcut-2.0.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; mapbox_earcut-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl; mapbox_earcut-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl; mapbox_earcut-2.0.0-cp311-cp311-win32.whl; mapbox_earcut-2.0.0-cp311-cp311-win_amd64.whl; mapbox_earcut-2.0.0-cp311-cp311-win_arm64.whl; mapbox_earcut-2.0.0-cp312-cp312-macosx_10_13_x86_64.whl; mapbox_earcut-2.0.0-cp312-cp312-macosx_11_0_arm64.whl; mapbox_earcut-2.0.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “polygon triangulation”
- mapbox-earcutFast 2D polygon triangulation using the Mapbox Earcut algorithm, with…
- bermudaProvides Rust-accelerated triangulation functions for 2D paths and…
- triangleTriangle wraps Jonathan Richard Shewchuk's C library to generate…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also bermuda · triangle · pyclipper · cytriangle · shapely-polyskel · quadrilateral-fitter · gdstk · vhacdx · pygeoif