← Back

ofxVoronoi

github.com/madc/ofxVoronoi · @madc
OF 0.11 Graphics

Simple two-dimensional Voronoi diagrams

45 20 Last commit 5y ago Created 12y ago

Forks

Forks pushed to more recently than madc/ofxVoronoi itself, plus any admin-confirmed fork with commits of its own — worth checking if you're hitting issues with the original.

ofWorks/ofxVoronoi by @ofWorks · ★ 2 · pushed 1y ago

README

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 Amnon Owed Kyle McDonald Rafael Redondo

Get this addon

HTTPS
SSH