Jump to content
Sign in to follow this  
etudenc

Set N points to same Y position

Recommended Posts

Hi all,

Please see the attached picture -- for every three points, I want the second and third to match the position in Y of the first.  So I'd like points 1 and 2 to match the Y position of 0, points 4 & 5 to match the Y position of 3, and so on up the row of points.  So far I'm not having luck with a wrangle, have tried to use a For-Each but no joy. Any suggestions?

Failed attempt in a point wrangle:

vector pos, oldPos;
int pt;
if(@id%3==0) {

   pt=@id;
   pos=point(0,"P",0);
   oldPos=point(0,"P",(pt+1));
   setpointattrib(0, "P", 1, set(oldPos.x, pos.y, oldPos.z));
   
   }

 

 

 

points.jpg

Share this post


Link to post
Share on other sites

when running over points, you should be able to do this in a single line of a wrangle ;) :

v@P.y = floor(float(@ptnum)/3) * 2; //if you want 2 y units between every group.

Share this post


Link to post
Share on other sites

Thank you both!  Noobini, your solution did the trick, and thank you for the HIP file.

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
Sign in to follow this  

×