random length to add up to exact distance

   1324   2   0
User Avatar
Member
4 posts
Joined: Oct. 2014
Offline
I’m trying to create a row of planes, the length of each individual plane is described with (rand(stamp(“../.”,“jones”,0)*$F)*28)+4 using a ForEach SOP. The total length of the planes should be the exact distance as set in a line node.

Inside an if() statement I wanted the bbox to look at the D_XMAX of the each node inside the ForEach SOP and compare it to the distance set in the line node. if the bbox is smaller then the line I would like to add another iteration to the for each node using something like this:
(distance – bbox) > 36 than add a new iteration.
(distance – bbox) < 36 than set result as plane size.

I think I need to build this part into the length of the planes. So the real question that remains is how to add another iteration to the ForEach SOP.

Any thoughts or feedback is appreciated!

Marcel
User Avatar
Member
7740 posts
Joined: July 2005
Offline
You could try just setting the ForEach SOP to run a high number of iterations (eg. length of line segment divided by minimum plane width). And then you can put an expression on the “Stop Condition” parameter to tell it to stop when you've reached the desired length. You'll need to accumulate the acquired length on each iteration to do this of course.
User Avatar
Member
4 posts
Joined: Oct. 2014
Offline
Hey Edward,

Thanks for your reply, I was going crazy over this. Once I re-read the help file for the ForEach sop, I noticed that the stop condition only takes a 0 or 1. this was my mistake.

I guess I just needed the confirmation that it could be done with the for each sop

anyway, Thanks again.

ML
  • Quick Links