The polygon triangulator from a map engine has been released as a new library called earstrip. It is available as a single C++ header file and a WebAssembly build on npm. The library is licensed under the ISC license, matching the license used by earcut.
In C++, earstrip is 14% faster than earcut.hpp. For browser-based applications, earstrip.js demonstrates a performance increase of 1.4 to 2.1 times compared to earcut.js. The library was able to triangulate 3,740,425 polygons from a map of the Masovian Voivodeship in 489 milliseconds on one core of an M4 Pro.
GPUs process triangles exclusively, while maps consist primarily of polygons representing features like buildings, parks, and roads. Before these polygons can be rendered, they must be converted into triangles through a process called triangulation. For example, 331 polygons with 5,151 vertices can become 4,514 triangles.
The earstrip library was developed by replacing a constrained Delaunay triangulator with an ear clipping algorithm. The development involved an iterative process where each idea was implemented and timed on the same dataset of 3.7 million polygons to measure performance improvements.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A new C++ and WebAssembly library, earstrip, has been released under the ISC license for polygon triangulation. It is 14% faster than earcut.hpp in C++ and 1.4 to 2.1 times faster than earcut.js in browsers, processing 3.7 million map polygons in 489 ms. This development provides a performance improvement for rendering map data, which relies on triangulating polygons for GPU processing.