tem_stlCubeOverlap Function

public function tem_stlCubeOverlap(stl_data, cube) result(overlaps)

Compute, if the triangles in stl intersects the cube.

Arguments

Type IntentOptional Attributes Name
type(tem_stlData_type), intent(in) :: stl_data
type(tem_cube_type), intent(in) :: cube

Return Value logical


Calls

proc~~tem_stlcubeoverlap~~CallsGraph proc~tem_stlcubeoverlap tem_stlCubeOverlap proc~tem_trianglecubeoverlap tem_triangleCubeOverlap proc~tem_stlcubeoverlap->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 proc~axistest->proc~cross_product3d

Called by

proc~~tem_stlcubeoverlap~~CalledByGraph proc~tem_stlcubeoverlap tem_stlCubeOverlap proc~tem_shape_subtreefromgeominters tem_shape_subTreeFromGeomInters proc~tem_shape_subtreefromgeominters->proc~tem_stlcubeoverlap 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 proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList proc~tem_create_subtree_of_st_funlist->proc~tem_create_subtree_of proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_subtree_of proc~tem_init_tracker_subtree tem_init_tracker_subTree proc~tem_init_tracker_subtree->proc~tem_create_subtree_of proc~tem_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_create_subtree_of

Source Code

  function tem_stlCubeOverlap(stl_data, cube) result(overlaps)
    !--------------------------------------------------------------------------!
    type(tem_stlData_type), intent(in) :: stl_data
    type(tem_cube_type), intent(in) :: cube
    logical :: overlaps
    !--------------------------------------------------------------------------!
    integer :: iTri
    type(tem_triangle_type) :: triangle
    !--------------------------------------------------------------------------!

    overlaps = .false.
    do iTri=1, stl_data%nTris
      triangle%nodes(:,1) = stl_data%nodes( :, stl_data%tri_node(1,iTri) )
      triangle%nodes(:,2) = stl_data%nodes( :, stl_data%tri_node(2,iTri) )
      triangle%nodes(:,3) = stl_data%nodes( :, stl_data%tri_node(3,iTri) )
      overlaps = overlaps .or. tem_triangleCubeOverlap(triangle, cube)
      ! if intersection is found then terminate the loop and return overlaps
      if (overlaps) return
    end do

  end function tem_stlCubeOverlap