All Projects → axelboc → voronoi-delaunay

axelboc / voronoi-delaunay

Licence: MIT license
Implementation of the Bowyer-Watson algorithm for computing Delaunay trianglulations and Voronoi diagrams

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Voronoi - Delaunay

This JavaScript program positions a set of vertices (the seeds) randomly on an HTML5 canvas (the plane), then computes and draws their Voronoi diagram.

The script first computes the Delaunay triangulation of the vertices using the Bowyer-Watson algorithm. It then deduces the Voronoi diagram from the triangulation. The Bowyer-Watson algorithm is an insertion algorithm; it builds the Delaunay triangulation one vertex at a time.

This program is written in vanilla ES2015 JavaScript. It has no dependencies and runs locally in any modern browser.

Demo

Visit http://bit.ly/voronoi-delaunay-v21 - a new diagram should be generated automatically. Then, use the controls in the sidebar to:

  • generate a new diagram,
  • change the size of the diagram (i.e. the number of seeds),
  • show or hide parts of the diagram (the seeds, the Delaunay triangulation, and the Voronoi diagram itself), or
  • switch to manual mode.

In manual mode, the construction of the Delaunay triangulation is performed step by step. Use the Next button to show the next step, and the Reset button to start the construction again with the same seeds.

The state of the interface is persited to localStorage and restored on page load.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].