Delaunay triangle and Voronoi diagram image generator

Generate pretty (to me) geometric images using math!

Licensed under mit

Delaunay triangle and Voronoi diagram image generator

This is a very tiny browser-based javascript mini-app that produces a random geometric pattern. Using the Delaunay algorithm, build a set of triangles from a set number of randomized points on the screen. Then, build a Voronoi diagram from adjacent triangles. Each cell in the diagram is colored using a color along a gradient.

An example of what gets generated

The hard work and algorithim implementation details are all handled by d3-delaunay library, huge thanks to Mike Bostock for the library, and the rest of the d3 ecosystem, and all of the contributors for making this feasible for me.

And a big thanks to the Skypack CDN for hosting the libraries involved!


Refresh the page, and the points will be randomized again, producing a new image. Then, when you're happy, you can save the generated image. There are keyboard shortcuts available, too:


There isn't anything to install, it's all static files. So, put it anywhere you can send static files from. Lazy? Here's a one-line ruby command:

ruby -run -ehttpd . -p8000