Javascript applet to demonstrate Steve Fortune's algorithm to compute Voronoi graphes (non-optimized)

< Home

TOFIX: The algorithm which I borrowed as a base for this Javascript implementation has a problem with open-ended edges bound to a single vertex: There is no way to tell the direction of the edge. Working on fixing this by getting rid of Forture's balanced binary tree and using a simple ordered list of beach sections (I wanted to do this to simplify the code, but this happens to be the solution for the problem too.
TODO: to support animation of event processing; to let the user input data textually with auto-scaling of values; to terminate properly the graph with a bounding box; to allow dragging existing sites with the mouse, etc. etc.
canvas size to pixels × pixels (new sites will be regenerated)
sites randomly, or...

Sites: The input is scanned for consecutive pairs of values which are interpreted as (x,y) – any non-valid number character is interpreted as a separator. If most sites supplied are located outside the canvas, an automatic mapping algorithm will kick in.
Lattices: The input is scanned for consecutive quadruplets of values which are interpreted as (offset x, offset y, delta x, delta y) – any non-valid number character is interpreted as a separator. Example, try: 0,0,60,100,30,50,60,100

Voronoi

This page displays properly only if Javascript is enabled.

Event queue


(down arrow works too)

Number of sites: ?
Number of events in the queue: 0
Total number of events processed: 0
Total number of false alarms (non-empty circles): 0
Total number of vertices: 0
Total number of edges: 0

Snapshots...

   

Portions of this software are based on the work of...

You are free to use or reuse all or portion of this code, linking back to the current page would be appreciated though. Email Raymond Hill for feedbacks/comments about this page.

Elsewhere...

Other online Voronoi-related applets: