https://github.com/mourner/delaunator-rs
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.
https://github.com/mourner/delaunator-rs
algorithms delaunay-triangulation geometry rust spatial
Last synced: about 1 year ago
JSON representation
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.
- Host: GitHub
- URL: https://github.com/mourner/delaunator-rs
- Owner: mourner
- License: isc
- Created: 2018-09-13T11:51:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T17:22:49.000Z (over 1 year ago)
- Last Synced: 2025-05-15T06:03:02.807Z (about 1 year ago)
- Topics: algorithms, delaunay-triangulation, geometry, rust, spatial
- Language: Rust
- Homepage: https://docs.rs/delaunator
- Size: 121 KB
- Stars: 222
- Watchers: 4
- Forks: 29
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Geospatial - delaunator-rs - A very fast static 2D Delaunay triangulation library for Rust. (Rust)
README
# delaunator-rs
An incredibly fast and robust Rust library for [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) of 2D points. A port of [Delaunator](https://github.com/mapbox/delaunator).
[](https://crates.io/crates/delaunator)
[](https://github.com/mourner/delaunator-rs/actions/workflows/test.yml)
## [Documentation](https://docs.rs/delaunator)
## Example
```rust
use delaunator::{Point, triangulate};
let points = vec![
Point { x: 0., y: 0. },
Point { x: 1., y: 0. },
Point { x: 1., y: 1. },
Point { x: 0., y: 1. },
];
let result = triangulate(&points);
println!("{:?}", result.triangles); // [0, 2, 1, 0, 3, 2]
```
## Performance
Results for 3.1 GHz Intel Core i7 on a Macbook Pro 15'' (2017):
| points | time |
| ---: | ---: |
| 100 | 16.478µs |
| 1,000 | 277.64µs |
| 10,000 | 3.753ms |
| 100,000 | 63.627ms |
| 1,000,000 | 898.78ms |
| 10,000,000 | 11.857s |