开发者发布了名为earstrip的开源多边形三角剖分库,相较现有主流算法在性能上有显著提升。1该库基于改进的耳切割算法,在C++中比earcut.hpp快14%,在浏览器环境中比earcut.js快1.4到2.1倍。1
earstrip采用了多项优化技术,包括仅测试凹顶点、条带化写入和分桶排序等方法。1在处理3,740,425个多边形时,该库仅耗时489毫秒(M4 Pro单核处理),而相同任务下Delaunay三角剖分算法的性能则慢6倍。1在实际应用中,对56,472个世界地图切片的处理中,earstrip耗时459毫秒,而earcut.hpp需要2,892毫秒,效率明显领先。1该库采用ISC许可证发布,同时提供C++头文件和WebAssembly npm包版本。1
A developer has released earstrip, an open-source polygon triangulation library that significantly outperforms existing solutions through an optimized ear clipping algorithm.1 The library achieves 14% faster performance than earcut.hpp in C++ and runs 1.4 to 2.1 times faster than earcut.js in web browsers.1 When processing 3,740,425 map polygons on an M4 Pro single-core processor, earstrip completed the task in 489 milliseconds, compared to 2,892 milliseconds for earcut.hpp across 56,472 world map tiles.1
The performance gains stem from multiple optimization techniques implemented throughout the library, including testing only concave vertices, strip-wise output writing, and bucket sorting.1 In comparisons with Delaunay triangulation algorithms, earstrip demonstrates approximately 6 times faster execution.1 The library is distributed under an ISC license and is available in two forms: a C++ header file and a WebAssembly npm package for browser environments.1
评论
还没有评论,欢迎留下第一条。