// HACKER NEWS — CYBERSECURITY
Phyllotaxis: An audio-reactive LED display
One of nature's beautiful patterns captured in dancing lights
I’ve been fascinated by understanding patterns that appear in nature, through code. Communing with the inherent emergent patterns that exist in the universe.
The phyllotaxis is one such pattern, the expanding double-spiral shape that appears in the center of sunflowers, succulents, other plants. It’s surprisingly simple code:
Take a number of linear points on a radial line of a circle, and rotate each one by an increasing multiple of the golden ratio.
You get a neat point cloud out of this that already looks very much like a sunflower. Voronoi tessellating it looks quite interesting and seed-pod-like:
After experimenting with this for a while, I had the idea: what if I made it a physical object and put an RGB addressable LED in each cell? A kind of cellular LED matrix. I had built a rectangular neopixel matrix in high school, but I’d been waiting to find a more interesting shape for the next one.
I exported the cell edge data from my processing sketch, and imported it into a python sketch using the CadQuery library.
Wrote some code to build physical geometry out of the data:
This snippet, after constructing the total volume of all merged voronoi cells, subtracts the shrunk volume of each individual cell from the total, and then carves an LED-sized hole in each. Doing this for all cells yields the yellow shape below. I also split the geometry into four roughly equal quadrants at this point, each of which would fit on my 3D printer bed.
I exported the STEP files and did some post processing in FreeCAD, adding screw holes, building a thin version of it that acted as a ‘faceplate’ with paper under it. I cut and glued paper to the bottom of the thin version, and used the screw holes to screw it into the cell walls.