Jump to content

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


saca

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

Link to comment
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

 

 

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...