neilmendoza / ofxVoronoi

Simple two-dimensional Voronoi diagrams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ofxVoronoi

ofxAddons Thumbnail

This repo started as a fork of Vanderlins ofxVoronoi, but I ended up changing too much code and decided to make it an independent addon.

This addon allows the generation of simple two-dimensional voronoi diagrams inside openframeworks. It uses a modified version of Stephan Fortune's sweep line algorithm written by Chris H. Rycroft for the Voro++ project.

Basic Example

Now with added support for Lloyd's algorithm useful for relaxing the diagram for use with stippling effects.

Example:
Create as usual

ofxVoronoi relaxedVoronoi;
relaxedVoronoi.setBounds(bounds);
relaxedVoronoi.setPoints(points);
relaxedVoronoi.generate();

int relaxIterations = 3;
while(relaxIterations--){
	relaxedVoronoi.relax();
}

Contributors:
Todd Vanderlin
Matthias Esterl
Andreas Borg

About

Simple two-dimensional Voronoi diagrams


Languages

Language:C++ 98.4%Language:C 1.6%Language:Makefile 0.0%