warp.geometry.intersect_tri_aabb#

warp.geometry.intersect_tri_aabb(
v0: vec3f,
v1: vec3f,
v2: vec3f,
lower: vec3f,
upper: vec3f,
) → bool[source]#
  • Kernel: true
  • Python: true
  • Differentiable: false

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 (vec3 or vec3d), and share a coordinate space. lower must be componentwise less than or equal to upper. 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. Use vec3d for 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:

True if the triangle intersects the box, or False otherwise.

warp.geometry.intersect_tri_aabb(
v0: vec3d,
v1: vec3d,
v2: vec3d,
lower: vec3d,
upper: vec3d,
) → bool[source]
  • Kernel: true
  • Python: true
  • Differentiable: false

Double-precision overload of warp.geometry.intersect_tri_aabb().