kiryha Posted March 9, 2018 Share Posted March 9, 2018 I am not able to get per point distance (parallel processing?), got the value from the last iteration in the loop for each point. // Mesure distance between pairs of point in each line // Return as a @distance attribute int allPoints[] = expandpointgroup(0, "!*"); f@distance; foreach (int currentPoint; allPoints){ vector pointPosition_L = point(0, 'P', currentPoint); vector pointPosition_R = point(1, 'P', currentPoint); @distance = distance(pointPosition_L, pointPosition_R); } circlesBetweenLines_002.hipnc Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted March 9, 2018 Share Posted March 9, 2018 You can avoid parallel computing by setting the wrangle to detail or to numbers. A custom loop can then add up some offset value. Here is a rough sketch: float offset = 0.0; for(int i = 0; i < @elemnum; i++){ float size = rand(i + 123); vector pos = set(0, 0, offset); offset += size * 0.5; pos += set(0, 0, offset); int pt = addpoint(0, pos); setpointattrib(0, "pscale", pt, size * 0.5, "set"); } iterate_copies.hipnc 1 Quote Link to comment Share on other sites More sharing options...
kiryha Posted March 9, 2018 Author Share Posted March 9, 2018 Thanks, Konstantin! A very cool hint is setpointattrib(), I was looking for a way to add point attribute in detail mode! Quote Link to comment Share on other sites More sharing options...
haggi Posted March 10, 2018 Share Posted March 10, 2018 If you only want to know the distance of the same point id in input 1 you can keep the point wrangle type and the advantages of parallel execution: f@dist = length(@P - point(1, "P", @ptnum)); Of course this only works if the input 1 has the same number of points as the first input. 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 10, 2018 Share Posted March 10, 2018 my approach using one liners... vu_CurveLerp.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.