warp.geometry.intersect_seg_aabb#
- warp.geometry.intersect_seg_aabb( ) bool[source]#
Test whether a closed segment intersects an axis-aligned bounding box.
Endpoint, face, edge, and corner contact count as intersections. A zero-length segment is a point; zero-width boxes and axis-parallel segments 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:
p0 – First endpoint of the segment.
p1 – Second endpoint of the segment.
lower – Lower corner of the box.
upper – Upper corner of the box.
- Returns:
Trueif the segment intersects the box, orFalseotherwise.