Earcut - Polygon Triangulation

JSON →
library 3.0.2 ·javascript
verified May 27, 2026

Earcut is a JavaScript library designed for fast and lightweight polygon triangulation, primarily optimized for WebGL applications. The current stable version is 3.0.2. It aims to provide real-time triangulation performance in browsers by prioritizing raw speed and simplicity over guaranteed correctness for highly degenerate or self-intersecting polygons. It implements a modified ear slicing algorithm using z-order curve hashing, capable of handling holes, twisted polygons, degeneracies, and self-intersections. While it doesn't guarantee perfectly correct triangulation for all edge cases, it typically produces acceptable results for practical datasets. It differentiates itself from alternatives by its significant speed advantage, as evidenced by benchmarks, and was originally developed for Mapbox GL. Earcut is a 2D algorithm, and for 3D inputs, it processes data as if projected onto the XY plane, ignoring the Z-component.

total hits 15
actors 6 distinct systems
last hit 11h ago AhrefsBot
ByteDance
4
MetaBot
4
GPTBot
2
Script
1
Search engines
1

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇩🇪 Germany