MeshLib Documentation
Loading...
Searching...
No Matches
Triangle intersection

Classes

struct  MR::TriIntersectResult
 

Functions

template<typename T >
bool MR::doTrianglesIntersect (Vector3< T > a, Vector3< T > b, Vector3< T > c, Vector3< T > d, Vector3< T > e, Vector3< T > f)
 
template<typename T >
bool MR::doesEdgeXySeparate (const Vector3< T > &x, const Vector3< T > &y, const Vector3< T > &z, const Vector3< T > &u, const Vector3< T > &v, const Vector3< T > &w, Vector3< T > d)
 returns true if a plane containing edge XY separates point Z from triangle UVW
 
template<typename T >
bool MR::doTrianglesIntersectExt (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d, const Vector3< T > &e, const Vector3< T > &f)
 
template<typename T >
bool MR::doTriangleLineIntersect (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d, const Vector3< T > &e)
 checks whether triangle ABC and infinite line DE intersect
 
template<typename T >
bool MR::doTriangleSegmentIntersect (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d, const Vector3< T > &e)
 checks whether triangle ABC and segment DE intersect
 
template<typename T >
Vector3< T > MR::findTriangleSegmentIntersection (const Vector3< T > &a, const Vector3< T > &b, const Vector3< T > &c, const Vector3< T > &d, const Vector3< T > &e)
 this function input should have intersection
 
template<typename T >
std::optional< TriIntersectResultMR::rayTriangleIntersect_ (const Vector3< T > &oriA, const Vector3< T > &oriB, const Vector3< T > &oriC, const IntersectionPrecomputes< T > &prec)
 
std::optional< TriIntersectResultMR::rayTriangleIntersect (const Vector3f &oriA, const Vector3f &oriB, const Vector3f &oriC, const IntersectionPrecomputes< float > &prec)
 
std::optional< TriIntersectResultMR::rayTriangleIntersect (const Vector3f &oriA, const Vector3f &oriB, const Vector3f &oriC, const Vector3f &dir)
 
std::optional< TriIntersectResultMR::rayTriangleIntersect (const Vector3d &oriA, const Vector3d &oriB, const Vector3d &oriC, const IntersectionPrecomputes< double > &prec)
 
std::optional< TriIntersectResultMR::rayTriangleIntersect (const Vector3d &oriA, const Vector3d &oriB, const Vector3d &oriC, const Vector3d &dir)
 

Detailed Description

Function Documentation

◆ doesEdgeXySeparate()

template<typename T >
bool MR::doesEdgeXySeparate ( const Vector3< T > & x,
const Vector3< T > & y,
const Vector3< T > & z,
const Vector3< T > & u,
const Vector3< T > & v,
const Vector3< T > & w,
Vector3< T > d )

returns true if a plane containing edge XY separates point Z from triangle UVW

◆ doTriangleLineIntersect()

template<typename T >
bool MR::doTriangleLineIntersect ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d,
const Vector3< T > & e )

checks whether triangle ABC and infinite line DE intersect

◆ doTriangleSegmentIntersect()

template<typename T >
bool MR::doTriangleSegmentIntersect ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d,
const Vector3< T > & e )

checks whether triangle ABC and segment DE intersect

◆ doTrianglesIntersect()

template<typename T >
bool MR::doTrianglesIntersect ( Vector3< T > a,
Vector3< T > b,
Vector3< T > c,
Vector3< T > d,
Vector3< T > e,
Vector3< T > f )

checks whether triangles ABC and DEF intersect returns false if ABC and DEF are coplanar

◆ doTrianglesIntersectExt()

template<typename T >
bool MR::doTrianglesIntersectExt ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d,
const Vector3< T > & e,
const Vector3< T > & f )

checks whether triangles ABC and DEF intersect; performs more checks to avoid false positives of simple doTrianglesIntersect

◆ findTriangleSegmentIntersection()

template<typename T >
Vector3< T > MR::findTriangleSegmentIntersection ( const Vector3< T > & a,
const Vector3< T > & b,
const Vector3< T > & c,
const Vector3< T > & d,
const Vector3< T > & e )

this function input should have intersection

◆ rayTriangleIntersect() [1/4]

std::optional< TriIntersectResult > MR::rayTriangleIntersect ( const Vector3d & oriA,
const Vector3d & oriB,
const Vector3d & oriC,
const IntersectionPrecomputes< double > & prec )
inline

◆ rayTriangleIntersect() [2/4]

std::optional< TriIntersectResult > MR::rayTriangleIntersect ( const Vector3d & oriA,
const Vector3d & oriB,
const Vector3d & oriC,
const Vector3d & dir )
inline

◆ rayTriangleIntersect() [3/4]

std::optional< TriIntersectResult > MR::rayTriangleIntersect ( const Vector3f & oriA,
const Vector3f & oriB,
const Vector3f & oriC,
const IntersectionPrecomputes< float > & prec )
inline

◆ rayTriangleIntersect() [4/4]

std::optional< TriIntersectResult > MR::rayTriangleIntersect ( const Vector3f & oriA,
const Vector3f & oriB,
const Vector3f & oriC,
const Vector3f & dir )
inline

◆ rayTriangleIntersect_()

template<typename T >
std::optional< TriIntersectResult > MR::rayTriangleIntersect_ ( const Vector3< T > & oriA,
const Vector3< T > & oriB,
const Vector3< T > & oriC,
const IntersectionPrecomputes< T > & prec )