Jump to content

L-system avoid self-intersection


Recommended Posts

Hey guys, 

I am currently experimenting in 2D with L-system. I am wondering if there is a way to prevent branches to intersect / cross ? Like I would rather has my branch to stop than crossing another one / itself like in the picture5e94cecc3973a_2020-04-1321_37_08-D__02-RESSOURCES_Houdini__HOUDINILIBRAIRY_00-Basic-Geo_L-System2D.hip-Houdini.thumb.png.f50b205276c6e991871cc9007fa208e7.png

Link to comment
Share on other sites

L-systems aren't self-aware like that... they handle all their substitution iterations internally, so you have no way of crafting rules based on the previous iteration's geometry. You're better off either using a particle system / solver SOP instead, or handle overlaps after the L-system is done via detangle or some other solver that could clip or displace overlapping polylines.

  • Like 1
Link to comment
Share on other sites

Hum ok I see that is what I was thinking just wanted to be sure thank you! And is there a way to check the current orientation of the turtle ? Like say       X:($(x,y,z)=(x,y,z))=F      or even simpler       X:($(x)=x)=F      I know this is not good at all just wanna illustrate my words

Link to comment
Share on other sites

I had a similar problem and find that fusing with the power of 2 grid solves the problem, in my case.

Here you have some interesting examples. I'm just curious about what you do in 2d :wub:? @sneaky


1-file to notice

Rule 1 L = S
Rule 2 S = F”+[f-Y]F;G
Rule 3 Y = –[|F-F–FY]- Rule 4 G = FGF[+F]+Y Angle -3832 Generations


  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hey @Librarian thank you for your answer I am a bite late by now ahah been quite busy!
I wanted to create a plane surface, kind of a motherboard if u want!

I have to say I don't really understand ur notice and how it could help me ? If you have time to explain your point I would be interested for sure.
Few very interesting examples on this website but they all seem to intersect if I am not wrong!

To explain my self a little further I searched an example for you. Even if I know the guys from Panoply (tremendous work by the way in here) didn't used L-system it is the kind of structure I would like to achieve.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...