Point3D to cloudIndex

Questions related to plugins development
Post Reply
Tolier
Posts: 11
Joined: Mon Jul 09, 2018 2:49 pm

Point3D to cloudIndex

Post by Tolier »

Hi Daniel,

I haven't found a function that allows me to get the index of a point in the cloud when I give it 3D coordinates
For example, with this you can obtain approximate coordinates of the point you are aiming at:

Code: Select all

CCVector3d P;
pGLView->getClick3DPos(mouseEvent->pos().x(), mouseEvent->pos().y(), P)
But once the X, Y, Z has been stored, it is mandatory to go through the entire sizecloud and test each getpoint(index, Point) to obtain an index .

thanks
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Point3D to cloudIndex

Post by daniel »

In this case it would be more efficient to use the octree and find the 'nearest point' to the given coordinates (of course this point should actually be the input one). But of course computing the octree has a cost, so it has to be compared to looking through all the points. It's generally worth it if this operation is made several times.
Daniel, CloudCompare admin
Post Reply