2 releases

0.1.1 May 16, 2020
0.1.0 May 15, 2020

#18 in #triangulation

MIT license

19KB
467 lines

triangular

A Delauney triangulation library for rust

Calculates the Delauney Triangulation of a set of points

Examples

By default it expects points in the range of 0.0 - 1.0

use triangular::Triangulation;

// build a set of points
let points = vec![(0.3, 0.5),
                  (0.1, 0.6),
                  (0.4, 0.8)];

let triangles = Triangulation::new(&points).build::<usize>();
assert_eq!(&*triangles, &[2, 1, 0]);

lib.rs:

Calculates the Delauney Triangulation of a set of points

Examples

By default it expects points in the range of 0.0 - 1.0

use triangular::Triangulation;

// build a set of points
let points = vec![(0.3, 0.5),
                  (0.1, 0.6),
                  (0.4, 0.8)];

let triangles = Triangulation::new(&points).build();
assert_eq!(&*triangles, &[2, 1, 0]);

Dependencies

~1.5MB
~21K SLoC