Skip to content

Instantly share code, notes, and snippets.

View mdt-re's full-sized avatar

mdt.re mdt-re

View GitHub Profile
@mdt-re
mdt-re / voronoi-relaxation-animation.py
Created October 4, 2025 07:02
A python script to generate Voronoi animations.
#!/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.