Skip to content

Andreas-Edling/triangulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Triangulator

ci

Triangulator is a library written in Rust that given a set of 2D points, it creates a Delaunay triangulation. I.e. it minimizes acuteness of triangles. There are two ways to use the library, either call fn triangulate(..) which will give the final triangulation:

   use triangulator::*;
   let points = [Point::new(0.,0.), Point::new(1.,0.), Point::new(1.,1.), Point::new(0.,1.), Point::new(0.5,0.5)];
   let triangles = triangulate(&points).unwrap();

or, for getting transitional triangulations:

   use triangulator::*;
   let points = [Point::new(0.,0.), Point::new(1.,0.), Point::new(1.,1.), Point::new(0.,1.), Point::new(0.5,0.5)];

   let mut triangulator = Triangulator::new();
   triangulator.initial_triangulation(&points).unwrap();
   while triangulator.do_step(&points) {
       let triangles = triangulator.get_triangles();
       // do something with triangles
   }

Sample of what a triangulation will look like:

triangulation

About

A library for creating a Delaunay triangulation, given a set of 2D points

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages