For quite some time I’ve been revisiting the idea of procedurally creating images of stylized trees. I went through a number of approaches, techniques, and aesthetics. At one point I was working on a custom SVG renderer with a 3D projection. Different display issues in different browsers forced me to abandon this route and go full 3D. Turns out, this was just what I needed. This is my first generative project in 3D and I’m very pleased with the results. (I even 3D-printed one of the trees and I keep it on my desk.)
In this post I include a selection of images I created when working on this project: different algorithms, different seeds, different techniques.
My favourite are the ones with mirrored and repeated branches. They exemplify qualities that I like the most in generative art: patterns emerging from a large number of simple elements, organic shapes contrasted against unnatural precision.
![](/static/assets/metal-trees/triptychs/1.png?28959b5e0fabf64ace9905a3739fb068)
![](/static/assets/metal-trees/triptychs/2.png?269f108ea871238c0beb43ac1a61f508)
![](/static/assets/metal-trees/triptychs/3.png?afaff21379b63b0db42379187fdf6716)
![](/static/assets/metal-trees/triptychs/4.png?7123195ef75c0b66ec76cf1a85f62eb7)
![](/static/assets/metal-trees/triptychs/5.png?9db2fd5876ff8288ccf2bb2cb2dca5ee)
![](/static/assets/metal-trees/big.png?da54b389a9f7a05d2e2ea3b2f6d2ebdf)
![](/static/assets/metal-trees/triptychs/6.png?d75af348f4f61b216b261f0a9a3bec7b)
![](/static/assets/metal-trees/triptychs/7.png?88bc4141f1559c7e8da7468d39f424d2)
Technical notes
- I wrote everything in Python. I save binary PLY files with edges (no faces) and load them in Blender.
- Blender can be scripted. I run it from the command line and make it execute a Python script that loads the PLY, adds volume to edges, sets materials, etc.
- Everything is automated. I make a change to the code, press ⌘S, and new images start appearing in the web browser next to the editor.
- The generation process is divided into two main phases. First, I create a “low poly” geometry with the overall shape. Then, I create individual “high poly” spaghetti strings, twist them around, bring them closer together near the tips, etc.
- To speed up iteration, I wrote a simple Redis-based queue to use multiple computers. Each machine creates geometry and renders an individual image. This approach works great for creating many renders at once, but it doesn’t help when I want to make a single high resolution image.