[vtkusers] Calculating the distance between two polyDatas

agerlach agerlach at gmail.com
Thu Feb 3 12:42:33 EST 2011


All,

I have two polyDatas that represent the same "object" (imagine one as a 3D
mesh derived from a 3D CAD model (call this polyData A) and the other as a
3D mesh obtained by 3D scanning a real-world object manufactured from the
CAD model (call this polyData B). Currently I can load both models and align
them, but now I what to visualize the difference between them by rendering
polyData A and then color the surface based on the "difference" between the
polyDatas.

I have seen several example that implement this by taking each point in A
and then searching for the closest point in B and calculating this
difference. However, I would like to specify the point used for calculating
the difference as the point in B closest to the surface normal extended from
the point in A.

Example: take point 1 in A and its surface normal. Then find the cell in B
that intersects with point 1's surface normal. Then approximate the location
on the cell that the normal intersects. This point - point 1 then becomes
the difference used in the visualization. I guess my question is what is the
best way to do this?

It looks like vtkCellLocator::intersectWithLine(...) will work, but I am a
little confused on how that method works. According to the documentation
this can return the cellId as well as a point. Is this point the centroid of
the cell, the 1 of 3 points that define the cell that is closest to the
intersection, or the point of intersection?

Thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Calculating-the-distance-between-two-polyDatas-tp3369677p3369677.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list