Return AABB octants.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_object), | intent(in) | :: | self | AABB. |
||
| type(aabb_object), | intent(out) | :: | octant(8) | AABB octants. |
pure subroutine compute_octants(self, octant)
!< Return AABB octants.
class(aabb_object), intent(in) :: self !< AABB.
type(aabb_object), intent(out) :: octant(8) !< AABB octants.
type(vector_R8P) :: vertex(8) !< AABB vertices.
integer(I4P) :: o !< Counter.
vertex = self%vertex()
octant(1)%bmin = self%bmin ; octant(1)%bmax = 0.5_R8P * (self%bmin + self%bmax)
octant(8)%bmin = octant(1)%bmax ; octant(8)%bmax = self%bmax
do o=2, 7 ! loop over remaining octants
octant(o)%bmin = 0.5_R8P * (self%bmin + vertex(o)) ; octant(o)%bmax = 0.5_R8P * (vertex(o) + self%bmax)
enddo
endsubroutine compute_octants