This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Generates a Voronoi tessellation within a rectangle and exports it as an SVG file. | |
This script uses scipy to compute the Voronoi diagram from a set of random | |
points and then clips the resulting polygons to a specified rectangular boundary. | |
Each cell is filled with a random color. | |
This shadow version creates a stepped animation using <set> tags, playing | |
forwards and then backwards through the relaxation steps. |