Basic L-system pattern modification (Anemone)

Hi everyone,

I am currently working on some basic L-system scripts that make use of the Anemone add-on.

I was able to replicate the most basic of examples, but I am afraid I was not able to achieve the specific pattern depicted in this image (also created with Anemone within GH):

The logic here has 2 steps, first it branches into an angled + straight line and then into two angled lines.
I can’t wrap my head around how to incorporate this double step logic…

Any insight much appreciated.

My def: Tree Test.gh (13.4 KB)

1 Like

Your def is not an L-System, it’s just a recursive system. An L-System has a grammar (symbols and rules) and a grammar interpreter (usually geometry), which is optional. Recursiveness basically means repeating the same process using the output as input (or calling itself into the process).

What you want to do would be very easy with an L-System, because a single symbol can be interpreted as those four lines, for example:

Simbols:
F (line), +(right turn), -(left turn), (open/close branches).

Rules:
F = F[+F][-F]-F <-this creates the 4 lines.

Initial axiom:
F

Iteration 0: F
Iteration 1: F[+F][-F]-F
Iteration 2: F[+F][-F]-F [+ F[+F][-F]-F ][- F[+F][-F]-F ]- F[+F][-F]-F
(…)

This will create one tree where each line (F) is replaced by those four. In the next iteration, each of these four lines will become new four lines, and so on. That’s how L-Systems work, by replacement, not by addition.

I suppose you can do this without using LS, but it won’t look the same. Try putting a process inside the loop that receives a line and generates those 4 lines at its end or in some way, here I did the test.
Tree Test.gh (15.7 KB)

I’m sure there’s another way to do it, but my head is asking for a bed.

1 Like

Ah, thanks Dani. I should have said, “a translation from an L-System”.
I think I prefer to stick to geometrical procedures instead of using the L-System notation though.


I checked the def you modified, but I think you misunderstood me. Here there are 4 branches starting from a single point (in the smaller branches) and in the bigger ones there are 9 starting from the same point. In my examples goal there is always 2 branches starting from a single point.

Anyways, rest well and thanks again for the info!

I did an example of the process you describe using Anemone + Pufferfish. You can find it in the Pufferfish example files. Should give you a good idea of the process. Example is in the workflow folder and is named “Pf_TwistedBoxMeshLSystem”

See here a video:

1 Like

The definition I gave you is just a sample concept, so I gave you instructions on how I think it could be done without using L-System. Try this, the logic is the same, just change the implementation.

Tree Test.gh (16.6 KB)

1 Like

Spam On.

Hard to see the usage of L stuff for that type of thing (unless you are in love with binary trees). Anyway … given the opportunity get an entry level proper recursion on that matter. Includes 2 challenges for the brave as well.

Recursion_LSTree_V1B_ForTheBrave.gh (134.7 KB)

Spam off.

1 Like