![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/Geometry/Line.h>
Class representing a line segment, i.e. More...
Inheritance diagram for LineSegment:Class representing a line segment, i.e.
a finite line defined by points at either end
Public Member Functions | |
| LineSegment (const vec3 &start, const vec3 &end) | |
| Creates a line segment from start to end. | |
| LineSegment (const LineSegment &)=default | |
| LineSegment & | operator= (const LineSegment &)=default |
| const vec3 & | start () const |
| Returns the start point, equivalent to LineBase::point. | |
| const vec3 & | end () const |
| Returns the end point. | |
| vec3 | direction () const override |
| Returns the normalized direction from start to end or NANs if those are the same point. | |
| double | length () const |
| Returns the distance between start and end points. | |
| bool | isApprox (const LineSegment &) const |
| Comparison using the same epsilon as Eigen::isApprox. | |
| double | clampLambda (double lambda) const override |
| Clamps the input to [0, length()]. | |
Public Member Functions inherited from LineBase | |
| const vec3 & | point () const |
| Returns a point on the line. | |
| vec3 | closestPoint (const vec3 &p) const |
| Returns the point on the line closest to p. | |
| double | distanceToPoint (const vec3 &p) const |
| Returns the L2 distance between p and the closest point on the line. | |
| bool | includesPoint (const vec3 &p) const |
| Returns if the distance between p and the closest point on the line is less than epsilon. | |
| std::vector< vec3 > | cylinderWallIntersection (const Line &axis, double radius) const |
| Computes the intersection points with the outer wall of a cylinder of infinite length, specified by radius and central axis. | |
| double | pointToLambda (const vec3 &p) const |
| Projects p onto the (extended) line and returns the unclamped lambda. | |
| vec3 | lambdaToPoint (double lambda) const |
| Returns point() + lambda*direction() | |
Protected Attributes | |
| vec3 | m_end |
| End of the line segment. | |
Protected Attributes inherited from LineBase | |
| vec3 | m_point |
| A point on the line. | |
| bool | operator== (const LineSegment &) const |
| Exact comparisons. | |
| bool | operator!= (const LineSegment &) const |
| Utils::Variant< LineSegment, vec3, std::nullptr_t > | shortestConnectingLine (const Line &l) const |
| Shortest connections to other lines. | |
| Utils::Variant< LineSegment, vec3, std::nullptr_t > | shortestConnectingLine (const LineSegment &l) const |
Additional Inherited Members | |
Protected Member Functions inherited from LineBase | |
| LineBase (const vec3 &p) | |
| LineSegment | ( | const vec3 & | start, |
| const vec3 & | end ) |
Creates a line segment from start to end.
If those points are the same, the line segment will mostly behave like a very inefficient point.
|
overridevirtual |
Returns the normalized direction from start to end or NANs if those are the same point.
Implements LineBase.
| Utils::Variant< LineSegment, vec3, std::nullptr_t > shortestConnectingLine | ( | const Line & | l | ) | const |
Shortest connections to other lines.
|
overridevirtual |
Clamps the input to [0, length()].
Implements LineBase.