[vtkusers] Numeric instability of FindClosestPoint from vtkCellLocator?

oyster sancho at whu.edu.cn
Sat Sep 12 03:03:00 EDT 2015

Hello vtk users:
I have just a 3D surface in triangles, 2400 points and 4600 cells.
After some kind of computation, for each point I have a new point, this
point do not necessarily  lies on the  Origin surface. So I use
vtkCellLocator and FindClosestPoint to project the new point onto the
surface. Here is the code snip:
/vtk_create(vtkCellLocator, celoc);

//some loop over the total vetices
vtk_create(vtkGenericCell, cell);
double t, x[3] = { meanx, meany, meanz }, nearest[3], dist2; //squared
vtkIdType cellId;
int subId=-1;				
celoc->FindClosestPoint(x, nearest, cell,cellId, subId, dist2);/

But the question is, every time I run the loop, I got points with different
positions. Is this some kind of numeric instabilities? If so, how can I
improve the analytic computation results with some kind more accurate
control? Or, am I missing something important?

BTW, I further tried vtkOBBTree and vtkModifiedBSPTree's intersectWithLine,
they also performs such instabilities.

Thanks in advance.

View this message in context: http://vtk.1045678.n5.nabble.com/Numeric-instability-of-FindClosestPoint-from-vtkCellLocator-tp5733872.html
Sent from the VTK - Users mailing list archive at Nabble.com.

More information about the vtkusers mailing list