tem_triangleCubeOverlap Function

public function tem_triangleCubeOverlap(triangle, cube) result(overlaps)

Compute, if the triangle intersects the cube.

Arguments

Type IntentOptional Attributes Name
type(tem_triangle_type), intent(in) :: triangle
type(tem_cube_type), intent(in) :: cube

Return Value logical


Calls

proc~~tem_trianglecubeoverlap~2~~CallsGraph proc~tem_trianglecubeoverlap~2 tem_triangleCubeOverlap proc~triboxoverlap_loc~2 triBoxOverlap_loc proc~tem_trianglecubeoverlap~2->proc~triboxoverlap_loc~2 proc~axistest~2 Axistest proc~triboxoverlap_loc~2->proc~axistest~2 proc~planeboxoverlap~2 planeBoxOverlap proc~triboxoverlap_loc~2->proc~planeboxoverlap~2 proc~cross_product3d cross_product3D proc~triboxoverlap_loc~2->proc~cross_product3d proc~axistest~2->proc~cross_product3d

Contents


Source Code

  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