Skip to content

ridoluc/Voronoi-Diagram

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Voronoi diagram builder

Fast and simple implementation of Fortune's Algorithm for building Voronoi diagrams.

Usage

Just create an instance of the VoronoiDiagram class providing a list of points and width and height of the canvas

    let points = [  
                    new Point(140,180),
                    new Point(230,200),
                    new Point(210,60)
                    ];

    let height = 300;
    let width = 300;

    // Create a new object
    let vor = new VoronoiDiagram(points, width, height);    
    
    // Build the diagram
    vor.update();

    // Edges of the Voronoi diagram
    let e = vor.edges;
    // Vertices of the Voronoi diagram
    let v = vor.voronoi_vertex;

About

Fortune's algorithm implementation for building Voronoi's diagrams

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published