expression help

   3797   2   0
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
I have created a circle and used a poly extrude sop to create a cylinder which I can then add subdivisions to.
I am looking at creating an expression that increases the amount of divisions the more I translate the extrude in Y

So far I know that I want a minium of 3 subdivisons per unit of lengh. So this is where I start to come unstuck, I have worked out that ( $BBY ) is the the height of my object at any time so if that should maybe measured in 0 to 1
(1-$BBY) from here I am not sure what or how my expression evaluates that it needs 3 subdivisions per unit of extrusion.

I was thinking it would be something like L = D * 3 with L= Lengh D= Divisions

Any help would be gratfully recieved

Rob
Gone fishing
User Avatar
Member
7725 posts
Joined: July 2005
Offline
I think you misunderstand what is $BBY. $BBY is the local variable within the Point SOP (among others) that says where the point is within the bounding box. So say the $TY of your point is 5 and the bounding box height is 10, then the $BBY for your point is 5/10=0.5. I'd be willing to guess that $BBY doesn't working the PolyExtrude SOP, least of all in the Divisions parameter because it doesn't make sense to evaluate it per point. It's a global value that related to how many points get created.

To do what you want, first note that the “ltz” parameter in the PolyExtrude SOP is the amount of extrusion. So you want an expression that is based on that value: ie. ch(“./ltz”) …. For each unit of this you want 3 divisions, so you just need to multiply the expression by 3. Finally, note that the Divisions parameter is an integer. Since you want “at a minimum 3 divisions per unit length”, you need to round the value up, arriving at the final expression: ceil(ch(“./ltz”)*3)
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
thankyou so much for your help edward

regard R
Gone fishing
  • Quick Links