Compute, if the triangle intersects the cube.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_triangle_type), | intent(in) | :: | triangle | |||
type(tem_cube_type), | intent(in) | :: | cube |
function tem_triangleCubeOverlap(triangle, cube) result(overlaps)
!--------------------------------------------------------------------------!
type(tem_triangle_type), intent(in) :: triangle
type(tem_cube_type), intent(in) :: cube
logical :: overlaps
!--------------------------------------------------------------------------!
real(kind=rk) :: halfwidth
!--------------------------------------------------------------------------!
! halfwidth is increased by eps to avoid precision problem in
! triangöe box intersection.
halfwidth = cube%halfwidth + eps
overlaps = triBoxOverlap_loc( cube%center, &
& [halfwidth, halfwidth, halfwidth], &
& triangle%nodes )
end function tem_triangleCubeOverlap