[vtkusers] vtkKdTreePointLocator sometimes gives wrong answer
wumengda at gmail.com
Fri Nov 7 00:47:54 EST 2008
I am trying to use vtkKdTreePointLocator to find the nearest point in a
Polydata to a given point.
The code I am using is as follows:
vtkKdTreePointLocator *kdt = vtkKdTreePointLocator::New();
kdt->SetDataSet( a_polydata );
vtkIdType id= kdt->FindClosestPoint(given_point_coordinate);
But I found "nearest_point_coordinate" is not always the right answer.
Sometimes, the result is
very far from the right answer. Am I missing something? Shouldn't the
returned variable "id"
be always the index of the nearest point?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers