Jump to content
sneaky

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hmm, I don't think there's any direct way to check the orientation. Maybe acos/asin? There aren't a ton of supported expressions in L-system rules.

Share this post


Link to post
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

benvan.co.uk/lsys/

1-file to notice

P L
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

 30

  • Like 1

Share this post


Link to post
Share on other sites

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.

5eb267d43f8a6_2020-05-0609_25_29-Window.thumb.png.92054f42cf5a9ab26601c4c77b70b4a8.png

Share this post


Link to post
Share on other sites

@sneaky
that solution it's already posted .. a million ways to do this in solver... have fun ...:wub:
just find file "13 fun" ( endless possibility) solver... first file

 

  • Like 1

Share this post


Link to post
Share on other sites

Oh ok ahah didn't search with the good key words thank a lot!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×