[vtkusers] vtkCellLocator FindClosestPoint

Tron Darvann trd at odont.ku.dk
Thu Sep 22 07:16:36 EDT 2005


Dear VTK users,
 
Can anyone give me a quick answer to this question:
 
I use vtkCellLocator and the method FindClosestPoint (vtk 4.2 and C++) to solve the following:  given a world coordinate, compute distance to closest point on a polygonal mesh, and the coordinates of the closest point.
 
In the documentaion for vtkCellLocator->FindClosestPoint() it sais
 
void vtkCellLocator::FindClosestPoint 	( 	 float 	   x[3], 	
		float 	   closestPoint[3], 	
		vtkIdType & 	   cellId, 	
		int & 	   subId, 	
		float & 	   dist2	
	) 	 	
  	Return the closest point and the cell which is closest to the point x. The closest point is somewhere on a cell, it need not be one of the vertices of the cell.   

Here it sais, in other words, that the returned closest point is an interpolation (? is this correctly understood ?)  across the cell.

HOWEVER, when I use vtkCellLocator->FindClosestPoint I always get exactly one of the points in the mesh, not an interpolation.  

Question: to get the interpolation (to get closest surface point, not only the one of the points in the mesh), is there a flag or something that I need to set? (Or do I have to compute it myself; however, this would be contradictory to the documentation it seems.)

Thanks for any help.

Tron Darvann

3D-Laboratory, Copenhagen

 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050922/ffff5047/attachment.htm>


More information about the vtkusers mailing list