Jump to content
Sign in to follow this  
Reza82N

question for pcopne() function

Recommended Posts

Posted (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 by Reza82N

Share this post


Link to post
Share on other sites

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

  • Like 1

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  

×