Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

OpenSCAD Voronoi Generator

by felipesanches, published

OpenSCAD Voronoi Generator by felipesanches Feb 6, 2013



OpenSCAD Voronoi Generator by felipesanches is licensed under the GNU - GPL license.

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag


Thing Statistics

9599Views 1746Downloads Found in Math Art


This is a script that generates Voronoi diagrams. You can round the corners and also determine whether to render or not the nuclei of the cells in the diagram.


The voronoi diagram can be generated eigther by providing a set of 2d points, or by generating a random set of n points.

More from Math Art

view more

All Apps

Upgrade this Thing with Thingiverse Apps


Edit, personalize, or revise this Thing

Customizer is the easiest way to take great 3D printable designs and make them your own. Make your OpenSCAD designs infinitely more valuable by empowering the community to customize them.

App Info Launch App
Customizer Thing App

I'm using this on a little project of mine (generating butterfly-wing-like images) by strategically placing several points on the wing, and using the Voronoi generator to draw the region outlines.

One undocumented area I had trouble with was the L, thickness, and round parameters to the voronoi() module, so here's what I figured out.

L is the radius of the "world"... the pattern is built within this circle.
thickness is the thickness of the lines between cells
round is the radius applied to corners (fillet in CAD terms).

These parameters need to be kept more or less in proportion to each other, and to the distance apart of the point_set. If one or the other is increased or decreased too much, you'll get no output.

The voronoi() function generates a 2D surface, which can be provided to
a) linear_extrude() to produce a 3D object
b) intersection() to restrict it to a a specified shape

Hope this helps someone,

This design is now also available at https://github.com/felipesanches/OpenSCAD_Voronoi_Generator

Thanks Decipher for reminding me of doing that :-)
I'll gladly review pull requests.

happy hacking,
Felipe Sanches

Thanks for the email nudge, will get my PR in ASAP.

Edit: PR done.


I've made some improvements to your code; simplifying it to use a shared function instead of two almost duplicate functions, removing the deprecated assign() module usage and adding randomness to the random seed if it is not supplied.

I was hoping you could create a repo for your initial version so that I can fork and do a PR, as I would also like to make some additional improvements.


Willing to share? Looking for å way to make a pattern on a shape I've already made.

See the top comment, check the github repo, I already did my PR.

hi, first let me say thank you for the great share...can you please tell me how to run this voronoi generator on an existing stl file ?

i have OpenScad on mac assuming the stl file is loaded ?

many thanks.

wow - looking at the source code, you definitely know how to use openscad !
would love to see more math from you :)

I do it as my full time job :-) Here's the openscad source code for the latest 3d printer design I've been working on, the Metamáquina2 desktop 3d printer: https://github.com/Metamaquina/Metamaquina2https://github.com/Metamaquina...

What a nice job! Think about an english version for your interesting printer website to get more vists! ;)

I have to say, that's incredibly awesome :-)

This is a really cool way to make organic seeming objects in OpenSCAD - great work!