ImFusion C++ SDK 4.4.0
ImFusion::Geometry::Line Class Referencefinal

#include <ImFusion/Core/Geometry/Line.h>

Class representing a full line, i.e. More...

Inheritance diagram for ImFusion::Geometry::Line:

Detailed Description

Class representing a full line, i.e.

one of infinite length.

See also
Intersections between geometry primitives can be computed using the sets of free functions Geometry::intersection() and Geometry::intersects().

Public Member Functions

 Line (const vec3 &point, const vec3 &direction)
 Creates a line going through point along direction.
 Line (const Line &)=default
Lineoperator= (const Line &)=default
vec3 direction () const override
 Returns the normalized direction vector.
bool isApprox (const Line &) const
 Comparison using the same epsilon as Eigen::isApprox.
Utils::Variant< LineSegment, vec3, std::nullptr_tshortestConnectingLine (const LineBase &l) const
 Returns the shortest connection to l as a LineSegment.
double clampLambda (double lambda) const override
 Returns the input without doing anything, since this line has no end points.
Public Member Functions inherited from ImFusion::Geometry::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_direction
 Normalized direction.
Protected Attributes inherited from ImFusion::Geometry::LineBase
vec3 m_point
 A point on the line.
bool operator== (const Line &) const
 Exact comparisons.
bool operator!= (const Line &) const

Additional Inherited Members

Protected Member Functions inherited from ImFusion::Geometry::LineBase
 LineBase (const vec3 &p)

Member Function Documentation

◆ direction()

vec3 ImFusion::Geometry::Line::direction ( ) const
overridevirtual

Returns the normalized direction vector.

Implements ImFusion::Geometry::LineBase.

◆ shortestConnectingLine()

Utils::Variant< LineSegment, vec3, std::nullptr_t > ImFusion::Geometry::Line::shortestConnectingLine ( const LineBase & l) const

Returns the shortest connection to l as a LineSegment.

If the objects intersect or overlap, a point on both lines is returned instead. Empty return indicates that either object is not well defined, i.e. contains NAN.

◆ clampLambda()

double ImFusion::Geometry::Line::clampLambda ( double lambda) const
overridevirtual

Returns the input without doing anything, since this line has no end points.

Implements ImFusion::Geometry::LineBase.


The documentation for this class was generated from the following file:
  • ImFusion/Core/Geometry/Line.h
Search Tab / S to search, Esc to close