mapbox/earcut.hpp
Fast, header-only polygon triangulation observed · 2026-08-28
Health v2 · maintenance only
82/100
- Activity 91
- Release rhythm 59
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4214
- days_rel: 61
- days_push: 57
- n_releases_24m: 1
Adoption not part of the score
1023 stars · 152 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A fast, header-only C++ port of the earcut.js polygon triangulation library, implementing a modified ear-slicing algorithm optimized with z-order curves and spatial hashing. It handles holes, self-intersections, and degeneracies, producing triangle indices suitable for real-time rendering of geographic and other 2D polygon data.
Use cases
- triangulate polygons with holes in C++
- convert geographic polygon shapes to triangle meshes for rendering
- fast real-time tessellation for a map renderer
- triangulate self-intersecting or non-simple polygons robustly
- header-only polygon triangulation without dependencies
- generate triangle indices for WebGL/OpenGL drawing
When to choose
- you need a small, dependency-free, header-only triangulation library
- raw triangulation speed matters more than guaranteed optimal mesh quality
- you're rendering geographic or map polygons in real time
- your polygons may contain holes, degeneracies, or self-intersections
When to avoid
- you need mathematically guaranteed-correct triangulation of arbitrary polygons
- you require high-quality Delaunay meshes as the primary output
- you need 3D or constrained Delaunay triangulation
Facets
library · maturity stable
graphics math parser graphics cpp cross-platform header-only triangulation tessellation computational-geometry ear-clipping polygon-mesh algorithms maps game-development
1 source
- readme: https://github.com/mapbox/earcut.hpp · fetched 2026-08-28 · 413f4a008400
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| mapbox/earcut.hpp | main | 82 |
For agents
markdown · JSON · MCP: product_card(name="mapbox/earcut.hpp")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem