7#ifndef PXR_BASE_GF_LINE_SEG_H
8#define PXR_BASE_GF_LINE_SEG_H
16#include "pxr/base/gf/api.h"
21PXR_NAMESPACE_OPEN_SCOPE
40 _length = _line.Set( p0, p1 - p0 );
62 return (_line == l._line && _length == l._length);
69 return ! (*
this == r);
98 double *t1 =
nullptr,
double *t2 =
nullptr );
110 double *t1 =
nullptr,
double *t2 =
nullptr );
116PXR_NAMESPACE_CLOSE_SCOPE
GfVec3d GetPoint(double t) const
Return the point on the line at ( p0 + t * dir ).
const GfVec3d & GetDirection() const
Return the normalized direction of the line.
Basic type: 3D line segment.
GfLineSeg(const GfVec3d &p0, const GfVec3d &p1)
Construct a line segment that spans two points.
GfVec3d GetPoint(double t) const
Return the point on the segment specified by the parameter t.
GF_API friend bool GfFindClosestPoints(const GfLine &, const GfLineSeg &, GfVec3d *, GfVec3d *, double *, double *)
Computes the closets points on line and seg.
const GfVec3d & GetDirection() const
Return the normalized direction of the line.
bool operator==(const GfLineSeg &l) const
Component-wise equality test.
GfLineSeg()
The default constructor leaves line parameters undefined.
GF_API friend bool GfFindClosestPoints(const GfLineSeg &, const GfLineSeg &, GfVec3d *, GfVec3d *, double *, double *)
Computes the closets points on two line segments, seg1 and seg2.
GF_API GfVec3d FindClosestPoint(const GfVec3d &point, double *t=NULL) const
Returns the point on the line that is closest to point.
bool operator!=(const GfLineSeg &r) const
Component-wise inequality test.
double GetLength() const
Return the length of the line.
Basic type for a vector of 3 double components.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
GF_API bool GfFindClosestPoints(const GfLine &line, const GfLineSeg &seg, GfVec3d *p1=nullptr, GfVec3d *p2=nullptr, double *t1=nullptr, double *t2=nullptr)
Computes the closets points on line and seg.