[vtkusers] How to find the distance from a point in a triangle to all three faces of the triangles.?

rakesh patil prakeshofficial at gmail.com
Tue Jun 21 23:37:35 EDT 2011


Hello,

I tried to google the solution for this problem. But I guess there is no
direct way to do this. The problem is as explained below:

There exists a trianglular mesh. Once I click on one of the element of the
mesh, it is to be checked whether user has clicked inside the triangle or on
the edges of triangle. If user has clicked inside the triangle, then, I need
to find the 3 distances, i.e. distance from the clicked point to the 3 edges
of the triangle (or 3 faces of the triangle). Is there a direct way to
achieve this task?

One way what I found was using this logic here

http://www.vtk.org/Wiki/VTK/Examples/Cxx/SimpleOperations/DistancePointToLine

Any other easy way will be appreciated.

Thanks in advance.

Regards
Rakesh Patil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110622/c0392459/attachment.htm>


More information about the vtkusers mailing list