L-System Edge Rewriting [SOLVED]

I’m trying to recreate the Gosper curve as described in the Algorithmic Beauty of Plants (pictured below) and I’m having trouble following the touchdesigners method for using edge rewriting. (https://docs.derivative.ca/index.php?title=LSystem_SOP#Edge_Rewriting)
I’ve attatched a .toe file with my attempt and the first generation works fine. But as the generations increase something goes wrong and I have no idea what as I’ve checked and rechecked my code several times and everything seems to be right according the the sources I’ve used but its still not working.
If anyone could help I’d really appreciate it as I’m losing my mind :slight_smile:
gosper

GosperCurve.3.toe (3.7 KB)

I’ve managed to solve my problem. Turns out the touchdesighner wiki is missing some information. I read that the houdini lsystem was the same so I had a look at their documentation and found the rules (below) that are missing from the TD wiki.
I tried editing the wiki but couldn’t get access so if anyone could fix this it would help future people struggling.
I’ve also uploaded my fixed .toe file for anyone interested.

Generations 10
Angle 90
Premise F(1,1,3,3,0)
Rule 1 F(i,j,k,l,m) :m=0 = F(i,j,k,l,0)+F(i,j,k,l,1)+
Rule 2 F(i,j,k,l,m) :m=1 =-F(i,j,k,l,0)-F(i,j,k,l,1)

GosperCurve.4.toe (3.6 KB)

1 Like