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 @note Todo implemented oriented box - cube overlap

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~~CallsGraph proc~tem_boxcubeoverlap tem_boxCubeOverlap proc~boxboxoverlap boxBoxOverlap proc~tem_boxcubeoverlap->proc~boxboxoverlap proc~tem_planecubeoverlap tem_planeCubeOverlap proc~tem_boxcubeoverlap->proc~tem_planecubeoverlap 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~cross_product3d cross_product3D proc~triboxoverlap_loc->proc~cross_product3d proc~planeboxoverlap planeBoxOverlap proc~triboxoverlap_loc->proc~planeboxoverlap

Called by

proc~~tem_boxcubeoverlap~~CalledByGraph proc~tem_boxcubeoverlap tem_boxCubeOverlap proc~tem_cano_initsubtree tem_cano_initSubTree proc~tem_cano_initsubtree->proc~tem_boxcubeoverlap proc~tem_shape_subtreefromgeominters tem_shape_subTreeFromGeomInters proc~tem_shape_subtreefromgeominters->proc~tem_cano_initsubtree proc~tem_shape2subtree tem_shape2subTree proc~tem_shape2subtree->proc~tem_shape_subtreefromgeominters proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->proc~tem_shape2subtree

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