Jump to content

Lsystem Problem


moonlightkiss

Recommended Posts

I have a Lsystem here and you'll notice as it grows the new branches start as thin tubes - i have tried every way I can think of it to make it look like cones.

I keep thinking that if I can just write the correct expression to get the metaballs to shrink it based on approximate distance to the center ... but I just can't seem to make it work.

If anyone can please help me to get these branches to look like pointy sticks all the time I would greatly appreciate it!!!!

forum_vines01.hip

post-985-1191543826_thumb.jpg

Link to comment
Share on other sites

I have a Lsystem here and you'll notice as it grows the new branches start as thin tubes - i have tried every way I can think of it to make it look like cones.

I keep thinking that if I can just write the correct expression to get the metaballs to shrink it based on approximate distance to the center ... but I just can't seem to make it work.

If anyone can please help me to get these branches to look like pointy sticks all the time I would greatly appreciate it!!!!

You can use the gen attribute to modify the width of the polywire for each generation of branches

For example, try something like this in the wire radius parameter of the polywire:

$WIDTH*.75*pow(fit($GEN,-1,9,1,0),1.2)

Try changing the exponent of the pow function to modify how quickly the branches taper. The 9 in the fit function is there because that's how many generations you are using in your L-system so if you change the number of generations remember to modify this value also.

Does that help you?

John Hughes

Link to comment
Share on other sites

Actually, what I'm really looking for is a way to make just the very tip small the entire time it grows, not just the later generations. See that image I posted - how it's tube shaped at the ends as it grows. I want it cone shaped at the end as it grows.

Any ideas?

OK, try this.

The larg attribute in an lystem looks like it helps find the tips of the geometry which is what you're going to need to find to make your cones at the end branches. I've not tested this method a great deal but seems to work OK in your case.

First you need to find the highest value of "larg". It changes as the Lsystem grows but is always the highest value. So one way to find the highest value of an attribute is to use the Sort SOP. Append the Sort SOP sfter your Lsystem (put it to the side so it is NOT connected to the downstream nodes). Set Point Sort to "By expresssion" and the Expression to -$LAGE. Now the first point will have whatever the highest value of the "larg" attribute is and we can easily reference it. You could have used CHOPs to find your max value but I like doing it this way.

Insert a group SOP after your Lsystem. This is connected to whatever you have downstream. Set group name to "not_tips" and entity to "Points". The idea is to make a point group that has all your points except for the ones in the tips. Use group by expression and set your expression to this:

$LAGE < point("../sort",0,"lage",0)

Now, similarly to my previous suggestion, you can modify your polywire expression so that the Lsystem is widened everywhere apart from the tips. Use an expression like this in the Wire Radius field:

$WIDTH*.75*haspoint("not_tips",opinputpath(".",0),$PT)

This does a look up into the group. If the point is not at the tip then the haspoint expression will be 1. If it is a tip point the haspoint expression will be 0 and therefore the polywire width will be zero at the tip. You should be able to easily modify it so that the expression returns a very small value rather than 0 if that's what you prefer (e.g. try wrapping a fit function around the haspoint function).

Any closer to what you were after?

john

Link to comment
Share on other sites

  • 7 months later...

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.

Guest
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...