Jump to content
saca

only one point from neibourhood and has maxmum ptNum from them.(VOP)

Recommended Posts

hi, i have a question.
does PointCloudOpen get some points?(parameter:Number of points > 1)

can i get only one point has maxmum ptNum from them ?

the point is 'c5' in this image.

points on circle c0~c5

points on line L0~02

the line position is center of the circle.

distance from L0~L2 to c0~c5 is same.

thanks.
 

VOP_Nearest_and_MaxPtNum.jpg

Nearest_MaxPtNum_v001.001.hip

Share this post


Link to post
Share on other sites

Ah man, I would also love to have something like that in VOP -s,( i see better somehow in vop-s) its the same thing I know , but I love Vops.

play with this endless possibility :wub:
 

vec.gif

FunvectorODFORCE.hipnc

Share this post


Link to post
Share on other sites

Hi, I am not skilled in vops, but here is the vex code, and file is attached.

The principle is:
For each found point (pciterate, while loop), you pcimport the point.number, and set this point.number to the "max_ptnum" attrib, only if currently iterated point.number is bigger than what is already stored in this attrib (all previously found point.numbers). At the end, you should have max_ptnum of all the found points.

In the Set Attribute VOP, it is called Merge Mode: Maxiumum

 

string Pchannel  = "P";
vector P         = @P;
float  radius    = 10.0;   // search within this radius
int    input     = 1;      // search in this input
int    maxpoints = npoints(1);
int    handle    = pcopen(input, Pchannel, P, radius, maxpoints);

while( pciterate(handle) == 1 )
{
    int found_ptnum;
    pcimport(handle, "point.number", found_ptnum); 
    
    // next line stores the found_ptnum, only if it is bigger then previously found
    setpointattrib(0, "max_ptnum", @ptnum, found_ptnum, "max");
}
pcclose(handle);

 

Nearest_MaxPtNum_v001.001_VEX.hiplc

 

 

Share this post


Link to post
Share on other sites

thanks!

in this case, i will using VEX  as you said.

i have tried using VOP-while,

VOP-while is very hard for understand.

 

  • 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

×