[vtkusers] finding nth nearest neighbors with polydata

David Doria daviddoria at gmail.com
Mon Jul 9 14:08:16 EDT 2012


On Mon, Jul 9, 2012 at 2:06 PM, Luke Hetrick <lhetrick at nnu.edu> wrote:
>
> Hello All,
>
>    I am trying to do something a bit different than typical. It seems to be an common thing to find the closest point to a seed point and after looking around the VTK library for a bit, it looks likethere are several ways to go about finding that. My question is how would I go about finding more than just the first closest neighbor, but more like up to the fifth nearest neighbor in polydata that contains randomized points? If anyone has done something like this or has an good idea about how to go about trying this, please share your thoughts.
>
> Luke H

I think you're looking for the FindClosestNPoints functions:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/KdTreePointLocator/ClosestNPoints

David



More information about the vtkusers mailing list