|
Lagrange
|
Geometric predicates and primitive intersection tests. More...
Enumerations | |
| enum class | IncludeBoundaryIntersection { No , Yes } |
| Controls whether boundary contact counts as intersection in triangle_triangle_intersection(). More... | |
Functions | |
| template<typename Scalar> | |
| bool | triangle_triangle_intersection (span< const Scalar, 3 > t1_v0, span< const Scalar, 3 > t1_v1, span< const Scalar, 3 > t1_v2, span< const Scalar, 3 > t2_v0, span< const Scalar, 3 > t2_v1, span< const Scalar, 3 > t2_v2, IncludeBoundaryIntersection boundary=IncludeBoundaryIntersection::No) |
| Check if two 3D triangles intersect using exact predicates for robustness. | |
Geometric predicates and primitive intersection tests.
|
strong |
#include <lagrange/utils/triangle_triangle_intersection.h>
Controls whether boundary contact counts as intersection in triangle_triangle_intersection().
| bool triangle_triangle_intersection | ( | span< const Scalar, 3 > | t1_v0, |
| span< const Scalar, 3 > | t1_v1, | ||
| span< const Scalar, 3 > | t1_v2, | ||
| span< const Scalar, 3 > | t2_v0, | ||
| span< const Scalar, 3 > | t2_v1, | ||
| span< const Scalar, 3 > | t2_v2, | ||
| IncludeBoundaryIntersection | boundary = IncludeBoundaryIntersection::No ) |
#include <lagrange/utils/triangle_triangle_intersection.h>
Check if two 3D triangles intersect using exact predicates for robustness.
This function uses Shewchuk's exact orient3D and orient2D predicates to robustly determine if two triangles intersect in 3D space. The algorithm tests each edge of one triangle against the other triangle using tetrahedra orientation tests, with special handling for coplanar cases using 2D projections.
| [in] | t1_v0 | First vertex of triangle 1. |
| [in] | t1_v1 | Second vertex of triangle 1. |
| [in] | t1_v2 | Third vertex of triangle 1. |
| [in] | t2_v0 | First vertex of triangle 2. |
| [in] | t2_v1 | Second vertex of triangle 2. |
| [in] | t2_v2 | Third vertex of triangle 2. |
| [in] | boundary | Whether touching at boundaries counts as intersection. |
| Scalar | The scalar type (e.g., float, double). |