tem_boxCubeOverlap Function

public function tem_boxCubeOverlap(box, cube) result(overlap)

This function checks for intersection of box and cube

Currently support only axis aligned box KM:

Arguments

Type IntentOptional Attributes Name
type(tem_box_type), intent(in) :: box
type(tem_cube_type), intent(in) :: cube

Return Value logical


Calls

proc~~tem_boxcubeoverlap~2~~CallsGraph proc~tem_boxcubeoverlap~2 tem_boxCubeOverlap proc~tem_planecubeoverlap tem_planeCubeOverlap proc~tem_boxcubeoverlap~2->proc~tem_planecubeoverlap proc~boxboxoverlap~2 boxBoxOverlap proc~tem_boxcubeoverlap~2->proc~boxboxoverlap~2 proc~tem_trianglecubeoverlap tem_triangleCubeOverlap proc~tem_planecubeoverlap->proc~tem_trianglecubeoverlap proc~triboxoverlap_loc triBoxOverlap_loc proc~tem_trianglecubeoverlap->proc~triboxoverlap_loc proc~axistest Axistest proc~triboxoverlap_loc->proc~axistest proc~planeboxoverlap planeBoxOverlap proc~triboxoverlap_loc->proc~planeboxoverlap proc~cross_product3d cross_product3D proc~triboxoverlap_loc->proc~cross_product3d

Contents

Source Code


Source Code

  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