[vtkusers] trying to use a locator to measure distance from a point to a surface

Jason Taclas jason.taclas.2006 at alum.bu.edu
Mon Apr 14 13:42:26 EDT 2008


I was wondering if anyone could help me; I am having trouble getting
vtkCellLocator to find the closest point on a surface from a point in
space.  I have tried using an example/testing program, and it seems to work
fine.

The flow of my application as it applies to the surface is as follows:
a segmented DICOM is read using vtkStructuredPointsReader
vtkMarchingCubes and vtkPolyDataConnectivityFilter are then used to create
the surface representation
A vtkCellLocator is created, using the output of
vtkPolyDataConnectivityFilter as the input data (I have also tried using
vtkMaskPoints to use the vertices as the input)

An error occurs whenever I attempt to use the FindClosestPoint method of the
Cell Locator.  A similar error would come up with the testing program
located here<http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Cxx/CellLocator.cxx?root=VTK&content-type=text/plain>when
you remove the line
sphere->SetThetaResolution(8); sphere->SetPhiResolution(8);
I was wondering if the surface I try to use is wrong for the locator, and if
there is any way to get this to work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080414/575ca741/attachment.htm>


More information about the vtkusers mailing list