This function checks for intersection of box and cube
Currently support only axis aligned box KM:
implemented oriented box - cube overlap
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_box_type), | intent(in) | :: | box | |||
type(tem_cube_type), | intent(in) | :: | cube |
function tem_boxCubeOverlap( box, cube ) result(overlap)
type(tem_box_type), intent(in) :: box
type(tem_cube_type), intent(in) :: cube
logical :: overlap
integer :: iPlane
if (box%only_surface) then
overlap = .false.
do iPlane = 1, 6
overlap = overlap .or. tem_planeCubeOverlap( box%plane(iPlane), cube)
end do
else
overlap = boxBoxOverlap( cube%center, &
& [cube%halfwidth, &
& cube%halfwidth, &
& cube%halfwidth], &
& box%center, &
& [box%halfwidth(1), &
& box%halfwidth(2), &
& box%halfwidth(3)], &
& box%normal)
end if
end function tem_boxCubeOverlap