#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.
- Parameters
-
| [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. |
- Template Parameters
-
| Scalar | The scalar type (e.g., float, double). |
- Returns
- True if the triangles intersect, false otherwise.
- Note
- Orientation and coplanarity decisions rely on Shewchuk's exact predicates for robustness. Some auxiliary computations (e.g., projection axis selection and collinear interval parameterization) use standard floating-point arithmetic.