Skip to content

Rust implementation of Fortune's algorithm for generating Voronoi diagrams

License

Notifications You must be signed in to change notification settings

petosegan/rust_voronoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

voronoi

This is a Rust implementation of Fortune's Linesweep algorithm for computing Voronoi diagrams.

Online Documentation

Usage

To use, add the following line to Cargo.toml under [dependencies]:

voronoi = "0.1.4"

or alternatively,

voronoi = { git = "https://github.com/petosegan/rust_voronoi.git" }

Example

extern crate voronoi;
use voronoi::{voronoi, Point, make_polygons};
const BOX_SIZE: f64 = 800.;
// ...
let vor_pts = vec![Point::new(0.0, 1.0), Point::new(2.0, 3.0), Point::new(10.0, 12.0)];
let vor_diagram = voronoi(vor_pts, BOX_SIZE);
let vor_polys = make_polygons(&vor_diagram);

TODO

  • Handle degeneracies in geometry.rs
  • Match DCEL faces to input points
  • Reimplement the data structures with memory management
  • Balance the trees
  • Benchmark against other implementations

About

Rust implementation of Fortune's algorithm for generating Voronoi diagrams

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages