[vtkusers] Find closest point on Mesh B from a point on Mesh A.

Ambar C ambarc at gmail.com
Sat Nov 27 16:33:17 EST 2010


Hello,

I have two meshes A and B. For each point on A, I need to find the
point on B that is closest to it. I looked up
vtkCellLocator::FindClosestPoint, and have a few questions about it.

1. In the function prototype

virtual void vtkCellLocator::FindClosestPoint	(	double 	x[3], double
	closestPoint[3], vtkGenericCell * 	cell, vtkIdType & 	cellId, int &
	subId, double & 	dist2	)

- What is the subId field? I understand that it is populated if and
when a closest point is found, but am not sure as to what information
it ends up holding.
- dist2 equals the distance of the closest point from the point x?
- Which cell's ID does vtkCellId end up holding?


In general, I'm confused about the usage of this function. Suggestions?

Best,
Ambar



More information about the vtkusers mailing list