[vtkusers] vtkLine

David Doria daviddoria at gmail.com
Wed Jun 8 19:12:23 EDT 2011


On Mon, May 2, 2011 at 11:17 AM, valentina armenise
<valentina.armenise at gmail.com> wrote:
> HI!
> I'm working with VTK for my master thesis and now I m facing a doubt. I need
> to compute the distance of a point from a segment defined by two vertexes. I
> found two functions in vtkLine.h
>
> // Compute distance to finite line. Returns parametric coordinate t
>
> // and point location on line.
>
> double vtkLine::DistanceToLine(double x[3], double p1[3], double p2[3],
>
>                               double &t, double closestPoint[3])
>
> // Determine the distance of the current vertex to the edge defined by
>
> // the vertices provided.  Returns distance squared. Note: line is assumed
>
> // infinite in extent.
>
> //
>
> double vtkLine::DistanceToLine (double x[3], double p1[3], double p2[3])
>
> So if I got it right, the first one gives me the distance from a segment
> defined by two vertexes and the second
>
> one gives me the distance from a line (infinite)? I got confused cause the
> documentation speaks about edge and not line.
>
> Can you help me?
>
> Which of these should I use?
>
> Thank you!

>From what I remember, I agree that the documentation (and the
functions themselves) are confusing. Did you ever figure this out? It
would be great if you could improve the documentation and submit a
patch to Gerrit.

David



More information about the vtkusers mailing list