Hi all,<br><br> I am trying to use vtkKdTreePointLocator to find the nearest point in a Polydata to a given point.<br>The code I am using is as follows:<br><br> vtkKdTreePointLocator *kdt = vtkKdTreePointLocator::New();<br>
kdt->SetDataSet( a_polydata );<br><br> vtkIdType id= kdt->FindClosestPoint(given_point_coordinate);<br> a_polydat->GetPoint(id, nearest_point_coordinate);<br><br> But I found "nearest_point_coordinate" is not always the right answer. Sometimes, the result is<br>
very far from the right answer. Am I missing something? Shouldn't the returned variable "id"<br>be always the index of the nearest point?<br><br>Thanks,<br>Mengda<br>