Jump to content

question for pcopne() function


Reza82N

Recommended Posts

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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...