Crate rtriangulate [−] [src]
A Rust implementation of the Delaunay triangulation algorithm presented by Paul Bourke.
Usage
Add the rtriangulate dependency to Cargo.toml
:
[dependencies]
rtriangulate = "0.1"
And use the crate as such:
extern crate rtriangulate; use rtriangulate::{Point, Triangle, triangulate}; // A list of points (which has to be sorted on x). let points = [Point::new(10.0, 50.0), Point::new(30.0, 40.0), Point::new(25.0, 40.0)]; let triangles = triangulate(&points); assert_eq!(triangles, [Triangle(0, 1, 2)]);
Structs
Edge |
An edge, represented by indexes into a list of points. |
Point |
A two-dimensional point. |
Triangle |
A triangle, represented by indexes into a list of points. |
Functions
triangulate |
Generate the Delaunay triangulation of given set of points. |