[vtkusers] Re:Distance between polydata and a point cloud
Cedric
cedric.schwartz at enst-bretagne.fr
Fri Oct 12 12:42:54 EDT 2007
Hi,
I'm not sure to understand what you really want in your first point
I'll only answer your second one :
You are right to use the vtkPointLocator to find the nearest point.
You should also have a look to the vtkKdTree class. It performs a
quickier search for the nearest point. But if you don't have so many
points vtkPointLocator is ok.
You can of course use your distance information to color your
polydata surface. You have to choose a rule to transform your
distance in R,G,B values (the rule depends on which colors you are
looking for) and then use it as the scalar values of the polydata
(exemple bellow).
color = vtkUnsignedCharArray::New()
for (i=0,...,number_of_points-1)
color->InsertTuples3(i,R,G,B)
polydata->GetPointData()->SetScalars(color)
Regards,
Cedric Schwartz
I'm looking to do two things; first I'd like to measure the average
distance between each point in a point cloud, and the polydata
surface it is registered to. I used the
vtkIterativeClosestPointTransform if that helps at all. The second
thing I would like to do is measure the distance between each point
in a polydata surface and the nearest point in the point cloud. From
reading the user's list archives, I imagine I might use
vtkPointLocator or vtkCellLocator, with FindClosestPoint, but I am
not sure.
I also wonder if it would be possible to use that information to
color-code the polydata object's surface (like a 'hot' or 'cold'
color scale) to better visualize a correlation between points and a
surface.
Jason Taclas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/vtkusers/attachments/
20071012/ca6c41f3/attachment-0001.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071012/8ce08f5e/attachment.htm>
More information about the vtkusers
mailing list