saca Posted June 10, 2020 Share Posted June 10, 2020 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. Nearest_MaxPtNum_v001.001.hip Quote Link to comment Share on other sites More sharing options...
Librarian Posted June 10, 2020 Share Posted June 10, 2020 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 FunvectorODFORCE.hipnc Quote Link to comment Share on other sites More sharing options...
ikoon Posted June 11, 2020 Share Posted June 11, 2020 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 Quote Link to comment Share on other sites More sharing options...
saca Posted June 12, 2020 Author Share Posted June 12, 2020 thanks! in this case, i will using VEX as you said. i have tried using VOP-while, VOP-while is very hard for understand. 1 Quote Link to comment Share on other sites More sharing options...
saca Posted June 12, 2020 Author Share Posted June 12, 2020 sample file. the problem was solved. thanks your advice. Nearest_MaxPtNum_v002.002.hiplc 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.