24#ifndef PXR_BASE_GF_LINE_SEG2D_H
25#define PXR_BASE_GF_LINE_SEG2D_H
33#include "pxr/base/gf/api.h"
37PXR_NAMESPACE_OPEN_SCOPE
56 _length = _line.Set( p0, p1 - p0 );
78 return (_line == l._line && _length == l._length);
85 return ! (*
this == r);
92 double *t1,
double *t2 );
114 double *t1 =
nullptr,
double *t2 =
nullptr );
127 double *t1 =
nullptr,
double *t2 =
nullptr );
129PXR_NAMESPACE_CLOSE_SCOPE
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
GfVec2d GetPoint(double t) const
Return the point on the line at ( p0 + t * dir ).
Basic type: 2D line segment.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
bool operator!=(const GfLineSeg2d &r) const
Component-wise inequality test.
GF_API friend bool GfFindClosestPoints(const GfLineSeg2d &, const GfLineSeg2d &, GfVec2d *, GfVec2d *, double *, double *)
Computes the closets points on two line segments, seg1 and seg2.
GfLineSeg2d()
The default constructor leaves line parameters undefined.
GfVec2d GetPoint(double t) const
Return the point on the segment specified by the parameter t.
GF_API friend bool GfFindClosestPoints(const GfLine2d &, const GfLineSeg2d &, GfVec2d *, GfVec2d *, double *t1, double *t2)
Computes the closets points on line and seg.
double GetLength() const
Return the length of the line.
bool operator==(const GfLineSeg2d &l) const
Component-wise equality test.
GF_API GfVec2d FindClosestPoint(const GfVec2d &point, double *t=NULL) const
Returns the point on the line that is closest to point.
GfLineSeg2d(const GfVec2d &p0, const GfVec2d &p1)
Construct a line segment that spans two points.
Basic type for a vector of 2 double components.
GF_API bool GfFindClosestPoints(const GfLine2d &line, const GfLineSeg2d &seg, GfVec2d *p1=nullptr, GfVec2d *p2=nullptr, double *t1=nullptr, double *t2=nullptr)
Computes the closets points on line and seg.