Using L Systems to model cities

I’d been meaning to research L Systems in Houdini for some time, and wow had I been missing something. I first came across them in some of Akira Saito‘s posts where he had made some interesting mech-like beings using their organic structure:

A recent tweet from Akira Saito

I’d squinted at them before in Houdini’s L System documentation but didn’t really make sense of it. I then came across a great in-depth tutorial (if you’re as geeky as me it’s well worth the time) by the eloquent houdinikitchen who overviews the theory well with lots of examples to give a good understanding:

HoudiniKitchen’s tutorial on L-Systems

The basic idea is that you provide a set of simpl(ish) instructions called Turtle commands that describe a starting state, such as:

F+FF

…which means “Branch up one (F), rotate 90 degrees (+), and then branch up twice (FF)

Then you give it more ‘simple’ rules using the same language that alter this basic structure every generation, such as:

F=FF++F++F+F++F-F

…which says “next generation, replace all the Fs in the previous statement with the instructions here”.

This can give rise to some complex plant-like structures like the ones shipped with Houdini:

Basic L-System Tree

But interestingly you can create things like hexagonal structures as well. After a little experimentation I quickly got what looks like a snowflake:

I then tweaked the “Generations” parameter so that Houdini was part-way through a generation, which gives a more distorted structure like this:

The same hexaganol structure but at generation 4.8

I then used my own random 3D Shape Generator node and a Copy to Points node to randomly create building like structures for each point in the ‘tree’ and got this effect:

Zoomed out…
…zoomed in a bit more….
…and closer

You can download the sample file here – it will require the Shape Generator asset to work, which maybe you’ll humbly consider supporting me by taking a look at it on Gumroad here: