24 #ifndef PXR_BASE_GF_LINE2D_H 25 #define PXR_BASE_GF_LINE2D_H 32 #include "pxr/base/gf/api.h" 36 PXR_NAMESPACE_OPEN_SCOPE
84 return _p0 == l._p0 && _dir == l._dir;
90 return ! (*
this == r);
116 double *t1 =
nullptr,
double *t2 =
nullptr);
118 PXR_NAMESPACE_CLOSE_SCOPE
120 #endif // PXR_BASE_GF_LINE2D_H
GfVec2d GetPoint(double t) const
Return the point on the line at ( p0 + t * dir ).
GfLine2d()
The default constructor leaves line parameters undefined.
GF_API GfVec2d FindClosestPoint(const GfVec2d &point, double *t=NULL) const
Returns the point on the line that is closest to point.
Basic type for a vector of 2 double components.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
double Normalize(double eps=GF_MIN_VECTOR_LENGTH)
Normalizes the vector in place to unit length, returning the length before normalization.
GF_API bool GfFindClosestPoints(const GfLine2d &l1, const GfLine2d &l2, GfVec2d *p1=nullptr, GfVec2d *p2=nullptr, double *t1=nullptr, double *t2=nullptr)
Computes the closets points between two lines.
GfLine2d(const GfVec2d &p0, const GfVec2d &dir)
Construct a line from a point and a direction.
bool operator==(const GfLine2d &l) const
Component-wise equality test.
bool operator !=(const GfLine2d &r) const
Component-wise inequality test.
GF_API friend bool GfFindClosestPoints(const GfLine2d &, const GfLine2d &, GfVec2d *, GfVec2d *, double *, double *)
Computes the closets points between two lines.