#include <opennurbs_line.h>
Public Member Functions | |
ON_Line () | |
Default constructor sets from = to = ON_3dPoint::Origin. More... | |
ON_Line (ON_3dPoint start, ON_3dPoint end) | |
ON_Line (ON_2dPoint start, ON_2dPoint end) | |
~ON_Line () | |
ON_BoundingBox | BoundingBox () const |
Get line's 3d axis aligned bounding box. More... | |
bool | ClosestPointTo (const ON_3dPoint &test_point, double *t) const |
Find the point on the (infinite) line that is closest to the test_point. More... | |
ON_3dPoint | ClosestPointTo (const ON_3dPoint &test_point) const |
Find the point on the (infinite) line that is closest to the test_point. More... | |
bool | Create (const ON_3dPoint start, const ON_3dPoint end) |
Create a line from two points. More... | |
bool | Create (const ON_2dPoint start, const ON_2dPoint end) |
ON_3dVector | Direction () const |
double | DistanceTo (ON_3dPoint test_point) const |
Find the point on the (infinite) line that is closest to the test_point. More... | |
bool | GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const |
Get line's 3d axis aligned bounding box or the union of the input box with the object's bounding box. More... | |
bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
Get tight bounding box. More... | |
bool | InPlane (ON_Plane &plane, double tolerance=0.0) const |
Get a plane that contains the line. More... | |
bool | IsFartherThan (double d, const ON_3dPoint &P) const |
Quickly determine if the shortest distance from this line to the other object is greater than d. More... | |
bool | IsFartherThan (double d, const ON_Line &L) const |
bool | IsValid () const |
double | Length () const |
double | MaximumDistanceTo (const ON_3dPoint &P) const |
Finds the longest distance between the line as a finite chord and the other object. More... | |
double | MaximumDistanceTo (const ON_Line &other) const |
double | MinimumDistanceTo (const ON_3dPoint &P) const |
Finds the shortest distance between the line as a finite chord and the other object. More... | |
double | MinimumDistanceTo (const ON_Line &L) const |
ON_3dPoint & | operator[] (int) |
line[0] = start point line[1] = end point More... | |
const ON_3dPoint & | operator[] (int) const |
ON_3dPoint | PointAt (double t) const |
Evaluate point on (infinite) line. More... | |
void | Reverse () |
For intersections see ON_Intersect();. More... | |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
rotate line about a point and axis More... | |
bool | Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
ON_3dVector | Tangent () const |
bool | Transform (const ON_Xform &xform) |
bool | Translate (const ON_3dVector &delta) |
Public Attributes | |
ON_3dPoint | from |
ON_3dPoint | to |
Static Public Attributes | |
static const ON_Line | NanLine |
static const ON_Line | UnsetLine |
static const ON_Line | ZeroLine |
ON_Line::ON_Line | ( | ) |
Default constructor sets from = to = ON_3dPoint::Origin.
ON_Line::~ON_Line | ( | ) |
|
explicit |
|
explicit |
ON_BoundingBox ON_Line::BoundingBox | ( | ) | const |
Get line's 3d axis aligned bounding box.
bool ON_Line::ClosestPointTo | ( | const ON_3dPoint & | test_point, |
double * | t | ||
) | const |
Find the point on the (infinite) line that is closest to the test_point.
test_point | [in] |
t | [out] line.PointAt(*t) is the point on the line that is closest to test_point. |
ON_3dPoint ON_Line::ClosestPointTo | ( | const ON_3dPoint & | test_point | ) | const |
Find the point on the (infinite) line that is closest to the test_point.
test_point | [in] |
bool ON_Line::Create | ( | const ON_3dPoint | start, |
const ON_3dPoint | end | ||
) |
Create a line from two points.
start | [in] point at start of line segment |
end | [in] point at end of line segment |
bool ON_Line::Create | ( | const ON_2dPoint | start, |
const ON_2dPoint | end | ||
) |
ON_3dVector ON_Line::Direction | ( | ) | const |
double ON_Line::DistanceTo | ( | ON_3dPoint | test_point | ) | const |
Find the point on the (infinite) line that is closest to the test_point.
test_point | [in] |
bool ON_Line::GetBoundingBox | ( | ON_BoundingBox & | bbox, |
int | bGrowBox = false |
||
) | const |
Get line's 3d axis aligned bounding box or the union of the input box with the object's bounding box.
bbox | [in/out] 3d axis aligned bounding box |
bGrowBox | [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox. If false, the object's bounding box is returned in bbox. |
bool ON_Line::GetTightBoundingBox | ( | ON_BoundingBox & | tight_bbox, |
bool | bGrowBox = false , |
||
const ON_Xform * | xform = nullptr |
||
) | const |
Get tight bounding box.
tight_bbox | [in/out] tight bounding box |
bGrowBox | [in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the line's tight bounding box. |
xform | [in] (default=nullptr) If not nullptr, the tight bounding box of the transformed line is calculated. The line is not modified. |
bool ON_Line::InPlane | ( | ON_Plane & | plane, |
double | tolerance = 0.0 |
||
) | const |
Get a plane that contains the line.
plane | [out] a plane that contains the line. The orgin of the plane is at the start of the line. The distance from the end of the line to the plane is <= tolerance. If possible a plane parallel to the world xy, yz or zx plane is returned. |
tolerance | [in] |
bool ON_Line::IsFartherThan | ( | double | d, |
const ON_3dPoint & | P | ||
) | const |
Quickly determine if the shortest distance from this line to the other object is greater than d.
d | [in] distance (> 0.0) |
P | [in] |
L | [in] |
bool ON_Line::IsFartherThan | ( | double | d, |
const ON_Line & | L | ||
) | const |
bool ON_Line::IsValid | ( | ) | const |
double ON_Line::Length | ( | ) | const |
double ON_Line::MaximumDistanceTo | ( | const ON_3dPoint & | P | ) | const |
Finds the longest distance between the line as a finite chord and the other object.
P | [in] |
L | [in] (another finite chord) |
double ON_Line::MaximumDistanceTo | ( | const ON_Line & | other | ) | const |
double ON_Line::MinimumDistanceTo | ( | const ON_3dPoint & | P | ) | const |
Finds the shortest distance between the line as a finite chord and the other object.
P | [in] |
L | [in] (another finite chord) |
double ON_Line::MinimumDistanceTo | ( | const ON_Line & | L | ) | const |
ON_3dPoint& ON_Line::operator[] | ( | int | ) |
line[0] = start point line[1] = end point
const ON_3dPoint& ON_Line::operator[] | ( | int | ) | const |
ON_3dPoint ON_Line::PointAt | ( | double | t | ) | const |
Evaluate point on (infinite) line.
t | [in] evaluation parameter. t=0 returns line.from and t=1 returns line.to. |
void ON_Line::Reverse | ( | ) |
For intersections see ON_Intersect();.
Reverse line by swapping from and to.
bool ON_Line::Rotate | ( | double | sin_angle, |
double | cos_angle, | ||
const ON_3dVector & | axis_of_rotation, | ||
const ON_3dPoint & | center_of_rotation | ||
) |
rotate line about a point and axis
bool ON_Line::Rotate | ( | double | angle_in_radians, |
const ON_3dVector & | axis_of_rotation, | ||
const ON_3dPoint & | center_of_rotation | ||
) |
ON_3dVector ON_Line::Tangent | ( | ) | const |
bool ON_Line::Transform | ( | const ON_Xform & | xform | ) |
bool ON_Line::Translate | ( | const ON_3dVector & | delta | ) |
ON_3dPoint ON_Line::from |
|
static |
ON_3dPoint ON_Line::to |
|
static |
|
static |