Skip to content
프로젝트

소개

A Rust port of the Earcut polygon triangulation library

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

earcut (Rust)

CI codecov Crates.io Version

A Rust port of the mapbox/earcut polygon triangulation library.

  • Tracks the triangulation behavior and optional Delaunay refinement from the latest earcut 3.2.4.
  • Designed to avoid unnecessary memory allocations. Internal buffers and the output index vector can be reused across multiple triangulations.
  • Also provides earcut::int::EarcutI32 for integer coordinates with exact integer predicates, but it can be slower than the float-based Earcut on modern CPUs.
  • An additional helper, utils3d::project3d_to_2d, projects coplanar 3D polygons onto a 2D plane for use with earcut.

Benchmarks

Time per iteration (smaller is better). Measured on a MacBook Pro (M4 Pro).

Polygon earcut.hpp (C++) earcut (Rust f64)
bad_hole 1.60 µs 1.21 µs
building 189 ns 95.5 ns
degenerate 93.9 ns 23.8 ns
dude 3.09 µs 2.82 µs
empty_square 188 ns 40.9 ns
water 135 µs 138 µs
water2 108 µs 102 µs
water3 8.73 µs 7.29 µs
water3b 843 ns 543 ns
water4 34.4 µs 36.9 µs
water_huge 834 µs 594 µs
water_huge2 1.80 ms 1.25 ms
water_huge3 18.1 ms 10.8 ms
MVT corpus 212 ms 175 ms

Public APIs: Rust reuses buffers; C++ allocates per call.

Demo

A simple egui-based visualizer for inspecting how earcut works.

cargo run --example visualizer

License

Licensed under either the MIT License (LICENSE-MIT) or the Apache License 2.0 (LICENSE-APACHE) at your option.

This project contains portions derived from mapbox/earcut, originally distributed under the ISC License (LICENSE-ISC).

관련 프로젝트 살펴보기

불러오는 중…