[vtkusers] 3D point cloud nearest neighbor search
David Doria
daviddoria at gmail.com
Thu Oct 14 07:53:32 EDT 2010
On Thu, Oct 14, 2010 at 4:43 AM, Benoist Laurent <benoist at ibpc.fr> wrote:
> Hi,
>
> A question related to the first one.
> I also have a 3D point cloud and I'd like to pick some of these points.
> Basically, I used a vtkKdTreePointLocator but the problem is that the
> distance between the cursor and the point takes into account the Z
> coordinates.
> Therefore, the cursor seems nearest from another point than the one that was
> picked.
>
> Any suggestion to look for the nearest neighbor taking into acount the X,Y
> coordinates?
> I mean what's the proper way to do so?
>
> Thanks,
> Benoist
I think you'd have to make a new object
vtkPoints* points = vtkPoints::New();
for (all points)
points->InsertNextPoint(x,y,0);
and build the tree from that.
David
More information about the vtkusers
mailing list