warp.geometry.intersect_tri_aabb#
- warp.geometry.intersect_tri_aabb( ) bool[source]#
Test whether a triangle intersects a closed axis-aligned bounding box.
Boundary contact counts as intersection. Degenerate triangles are treated as their segment or point convex hull; zero-width boxes are supported.
Coordinates must be finite, use the same type (
vec3orvec3d), and share a coordinate space.lowermust be componentwise less than or equal toupper. No tolerance is added; expand the bounds for a spatial margin. This is a floating-point predicate, not an exact predicate: roundoff and intermediate overflow or underflow can affect results. Usevec3dfor greater precision. The boolean result is not differentiable.- Parameters:
v0 – First vertex of the triangle.
v1 – Second vertex of the triangle.
v2 – Third vertex of the triangle.
lower – Lower corner of the box.
upper – Upper corner of the box.
- Returns:
Trueif the triangle intersects the box, orFalseotherwise.