Hi all,<br><br>&nbsp;&nbsp; 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>&nbsp; vtkKdTreePointLocator&nbsp; *kdt = vtkKdTreePointLocator::New();<br>
&nbsp; kdt-&gt;SetDataSet( a_polydata );<br><br>&nbsp; vtkIdType id= kdt-&gt;FindClosestPoint(given_point_coordinate);<br>&nbsp; a_polydat-&gt;GetPoint(id, nearest_point_coordinate);<br><br>&nbsp; But I found &quot;nearest_point_coordinate&quot; is not always the right answer. Sometimes, the result is<br>
very far from the right answer. Am I missing something? Shouldn&#39;t the returned variable &quot;id&quot;<br>be always the index of the nearest point?<br><br>Thanks,<br>Mengda<br>