A web toy to make Voronoi diagrams from random Delaunay triangulations. I think it looks neat!
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2021-06-19 19:12:47 -07:00
example-slice.png include a example of what gets generated 2021-06-19 19:12:47 -07:00
gradient.json pull the gradient out into a separate file 2021-06-19 18:51:51 -07:00
index.html a gray logo for gitlab & favicon 2021-06-19 19:02:11 -07:00
LICENSE.txt place under the MIT license 2021-06-19 18:11:46 -07:00
logo-gray.png add 'DVG' outlined text to the logo 2021-06-19 19:11:49 -07:00
README.md include a example of what gets generated 2021-06-19 19:12:47 -07:00

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!

Usage

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:

  • R - Reload the page
  • S - Prompt to download the generated image
  • ? - Show the list of keys

Installing

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