MeshLib
 
Loading...
Searching...
No Matches
Intersection

Functions

template<typename T >
std::optional< Line3< T > > MR::intersection (const Plane3< T > &plane1, const Plane3< T > &plane2, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
template<typename T >
std::optional< Vector3< T > > MR::intersection (const Plane3< T > &plane, const Line3< T > &line, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
template<typename T >
std::optional< Vector3< T > > MR::intersection (const Line3< T > &line1, const Line3< T > &line2, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
std::optional< Vector2fMR::intersection (const LineSegm2f &segm1, const LineSegm2f &segm2)
 
template<typename T >
std::optional< T > MR::distanceSq (const Plane3< T > &plane1, const Plane3< T > &plane2, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
template<typename T >
std::optional< T > MR::distance (const Plane3< T > &plane1, const Plane3< T > &plane2, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
template<typename T >
std::optional< T > MR::distance (const Plane3< T > &plane, const Line3< T > &line, T errorLimit=std::numeric_limits< T >::epsilon() *T(20))
 
template<typename T >
LineSegm3< T > MR::closestPoints (const Line3< T > &line1, const Line3< T > &line2)
 
template<typename T >
LineSegm3< T > MR::closestPoints (const Line3< T > &ln, const LineSegm3< T > &ls)
 
template<typename T >
LineSegm3< T > MR::closestPoints (const Line3< T > &line, const Box3< T > &box)
 finds the closest points between a line and a box wireframe (not solid) in 3D
 
template<typename V >
auto MR::intersection (const Line< V > &line, const Sphere< V > &sphere)
 

Detailed Description

Function Documentation

◆ closestPoints() [1/3]

template<typename T >
LineSegm3< T > MR::closestPoints ( const Line3< T > & line,
const Box3< T > & box )

finds the closest points between a line and a box wireframe (not solid) in 3D

◆ closestPoints() [2/3]

template<typename T >
LineSegm3< T > MR::closestPoints ( const Line3< T > & line1,
const Line3< T > & line2 )

finds the closest points between two lines in 3D; for parallel lines the selection is arbitrary;

Returns
two equal points if the lines intersect

◆ closestPoints() [3/3]

template<typename T >
LineSegm3< T > MR::closestPoints ( const Line3< T > & ln,
const LineSegm3< T > & ls )

finds the closest points between an infinite line and finite line segment in 3D; for parallel lines the selection is arbitrary;

Returns
two equal points if the lines intersect

◆ distance() [1/2]

template<typename T >
std::optional< T > MR::distance ( const Plane3< T > & plane,
const Line3< T > & line,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds distance between a plane and a line;

Returns
nullopt if they intersect

◆ distance() [2/2]

template<typename T >
std::optional< T > MR::distance ( const Plane3< T > & plane1,
const Plane3< T > & plane2,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds distance between a plane1 and a plane2

Returns
nullopt if they intersect

◆ distanceSq()

template<typename T >
std::optional< T > MR::distanceSq ( const Plane3< T > & plane1,
const Plane3< T > & plane2,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds squared distance between a plane1 and a plane2

Returns
nullopt if they intersect

◆ intersection() [1/5]

template<typename T >
std::optional< Vector3< T > > MR::intersection ( const Line3< T > & line1,
const Line3< T > & line2,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds an intersection between a line1 and a line2

Parameters
line1,line2should be normalized for check parallelism
Returns
nullopt if they are not intersect (even if they match)

◆ intersection() [2/5]

template<typename V >
auto MR::intersection ( const Line< V > & line,
const Sphere< V > & sphere )

finds intersection points between a line and a sphere; if found then returns parameters on the line

◆ intersection() [3/5]

std::optional< Vector2f > MR::intersection ( const LineSegm2f & segm1,
const LineSegm2f & segm2 )
inline

finds an intersection between a segm1 and a segm2

Returns
nullopt if they don't intersect (even if they match)

◆ intersection() [4/5]

template<typename T >
std::optional< Vector3< T > > MR::intersection ( const Plane3< T > & plane,
const Line3< T > & line,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds an intersection between a plane and a line

Parameters
plane,lineshould be normalized for check parallelism
Returns
nullopt if they are parallel (even line belongs to plane)

◆ intersection() [5/5]

template<typename T >
std::optional< Line3< T > > MR::intersection ( const Plane3< T > & plane1,
const Plane3< T > & plane2,
T errorLimit = std::numeric_limits<T>::epsilon() * T( 20 ) )

finds an intersection between a plane1 and a plane2

Parameters
plane1,plane2should be normalized for check parallelism
Returns
nullopt if they are parallel (even if they match)