[vtkusers] Calculating the distance between two polyDatas

Bill Lorensen bill.lorensen at gmail.com
Thu Feb 3 15:14:14 EST 2011


This example uses IntersectWithLine to shoot a ray through a terrain.
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/InterpolateTerrain

You can probably define your "ray" as a normal (extended to "infinity)
to find the intersection with another polydata.

On Thu, Feb 3, 2011 at 12:42 PM, agerlach <agerlach at gmail.com> wrote:
>
> 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.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list