6 releases (2 stable)

1.0.1 Oct 31, 2021
1.0.0 Oct 24, 2021
0.2.1 Jun 10, 2021
0.2.0 Sep 15, 2018
0.1.1 Sep 14, 2018

#158 in Algorithms

Download history 514/week @ 2022-08-11 553/week @ 2022-08-18 427/week @ 2022-08-25 328/week @ 2022-09-01 582/week @ 2022-09-08 472/week @ 2022-09-15 517/week @ 2022-09-22 474/week @ 2022-09-29 520/week @ 2022-10-06 546/week @ 2022-10-13 447/week @ 2022-10-20 523/week @ 2022-10-27 430/week @ 2022-11-03 476/week @ 2022-11-10 503/week @ 2022-11-17 217/week @ 2022-11-24

1,695 downloads per month
Used in 4 crates (3 directly)

ISC license

95KB
460 lines

delaunator-rs

An incredibly fast and robust Rust library for Delaunay triangulation of 2D points. A port of Delaunator.

delaunator on Crates.io Tests

Documentation

Example

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

Dependencies