Creating L-system algorithm to split faces of a mesh in half in geometry nodes

Hello,

As in the title - I need help figuring out how to properly create a L-system algorithm that would recursively (I think that’s the term) divide faces of a plane based on the User specified rules.

For example: Initial sentence - V
If → F
Then → +F-FF [ [ +F
Where: F → split face in half
+ → means split vertically in half (or rotate the cutter for the next cut clockwise)
- → means split horizontally in half (or rotate the cutter for the next cut counter
clockwise)
[ → skip face, go to face index+1

Idea inspired by explanation shown here:
L Systems in Blender Geometry Nodes

More in depth explanation of problem and my current solution:

I fake the solution a bit by doing a simplified take on it:

Where I use V and H as input and whenever V then → replace face with grid divided vertically, when H → replace face with grid divided horizontally

I found it to be easier than subdividing edges or converting to curves or using mesh boolean but it is not ideal (only works on rectangular faces aligned to the X and Y world axis).
As for face selection I simply use a set up to chose face with the last index in each iteration as a “skip to next face” step:

V group:

H group:

Problem is - this solution does not allow for a more robust and “true” simulation of L-System. For example L-systems use “+” and “-” signs to indicate a switch in direction and angle (in this case, vertical or horizontal subdivision) for the NEXT STEP. So rotating the cut by an angle for a given face.
Or allow to chose to omit a face and skip to the next one (or branching, but this would be too crazy at this stage I feel).

I hope I explained it in an understandable way (sorry if not, english is not my first language and I’m new to a more technical side of 3d and design).

Any ideas or suggestions are welcomed! Thank you for your time.

Here’s the blend file (saved in blender 5.0+ on factory default settings)

L-System_recursive_mesh_subd.blend (116.3 KB)

What’s the end result goal here? I’m not talking about the system you’re trying to build, I’m asking about what you want to do with that system once you have it built

Hello,

Thank you for your reply.
I would say that creating a setup for procedural street grid + city parcels or plot divisions (since in the city those are all connected) is the end goal here.
I’m currently researching different ways to create procedural city and street layouts and I’ve read about L-Systems recently as a way of doing that so I wanted to test it.

In addition I wanted to learn more advanced things from geometry nodes system in Blender.

I did other experiments in “Works in progress” topic I created some time ago if you are interested:

I hope that answers your question. Thank you for your time.

Hello, I’ve started a discussion over here on recursive closures.

Initial example here.

Superfluous collection hierarchy walker that could be replaced with a “Collection Children” node, but which still demonstrates halting conditions.

Hopefully something there may give you some ideas and inspiration.

Good luck.

Hello,

Thank you for your answer and help! I’m not familiar with closures and bundles so thank you for pointing me towards materials about them. I’ll go and research the topic and see what I can understand about it haha.

If I find a solution to my initial problem I’ll post it here.

Thanks again!