7 releases (3 stable)

1.0.2 Mar 21, 2023
1.0.1 Oct 31, 2021
0.2.1 Jun 10, 2021
0.2.0 Sep 15, 2018
0.1.1 Sep 14, 2018

#441 in Algorithms

Download history 1120/week @ 2024-03-14 1045/week @ 2024-03-21 1579/week @ 2024-03-28 1083/week @ 2024-04-04 1241/week @ 2024-04-11 1577/week @ 2024-04-18 507/week @ 2024-04-25 873/week @ 2024-05-02 784/week @ 2024-05-09 980/week @ 2024-05-16 818/week @ 2024-05-23 1786/week @ 2024-05-30 1190/week @ 2024-06-06 1437/week @ 2024-06-13 620/week @ 2024-06-20 907/week @ 2024-06-27

4,517 downloads per month
Used in 14 crates (9 directly)

ISC license

96KB
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

~480KB