Reza82N Posted May 18, 2019 Share Posted May 18, 2019 (edited) Hi guys, i am new to vex , in this very simple example i have some questions about pcopen() , i would be appreciated if you helped me, vector origin = point(1,"P",0) // a single point has been connected to first input of the wrangle int amount = chi("amount"); int radius = chi("radius"); int handle = pcopen(0 ,"P",origin,radius,amount); if (pcnumfound(handle)>0) { @Cd = {1,0,0}; ; } as i know for the code above : we have a radius around an origin to search for amount of point(s) connected to 1st input of the wrangle , then if some points have been found the statement would run for those points when i am going to translate what i have mentioned in the line above , i can't understand what is happening below , int amount = chi("amount"); int radius = chi("radius"); int handle = pcopen(1 ,"P",@P,radius,amount); // a single points has been connceted to 2nd input if(pcnumfound(handle)>0) { @Cd = {1,0,0}; } when i look to geometry spreadsheet , @P is referring to 1st input and the number 1 in pcopen() is referring to 2nd input , we have the origin (center of point cloud) from 1st input which is @P , and we are connecting the pcopen() to 2nd input of the wrangle, in result we have a point cloud which it's center is that external point , and the slide "amount" doesn't affects the number of points founded in the point cloud , i know i misunderstood something but i couldn't find it. the project file has been attached. Scott82N.hipnc Edited May 19, 2019 by Reza82N Quote Link to comment Share on other sites More sharing options...
julian johnson Posted May 19, 2019 Share Posted May 19, 2019 In your current scenario I think each point in your grid is doing a pointcloud lookup on the single point in input 2 and if it is in the radius will always only find 1 point. I think you need something like this which only does the point cloud lookup once in detail mode. Scott82N_detail.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.