Skip to content

fossil_aabb_object

FOSSIL, Axis-Aligned Bounding Box (AABB) class definition.

Source: src/lib/fossil_aabb_object.f90

Dependencies

Contents

Derived Types

aabb_object

FOSSIL Axis-Aligned Bounding Box (AABB) class.

Components

NameTypeAttributesDescription
bmintype(vector_R8P)Minimum point of AABB.
bmaxtype(vector_R8P)Maximum point of AABB.
facet_idtype(list_id_object)List of facets IDs contained into AABB.

Type-Bound Procedures

NameAttributesDescription
add_facetspass(self)Add facets to AABB.
closest_pointpass(self)Return closest point on AABB from point reference.
compute_octantspass(self)Compute AABB octants.
compute_vertices_nearbypass(self)Compute vertices nearby.
destroypass(self)Destroy AABB.
distancepass(self)Return the (square) distance from point to AABB.
distance_from_facetspass(self)Return the (square) distance from point to AABB's facets.
do_ray_intersectpass(self)Return true if AABB is intersected by ray.
get_aabb_facetspass(self)Get AABB facets list.
has_facetspass(self)Return true if AABB has facets.
initializepass(self)Initialize AABB.
is_insidepass(self)Return the true if point is inside ABB.
medianpass(self)Return the median of AABB.
ray_intersections_numberpass(self)Return ray intersections number.
save_geometry_tecplot_asciipass(self)Save AABB geometry into Tecplot ascii file.
save_facets_into_file_stlpass(self)Save facets into file STL.
translatepass(self)Translate AABB by delta.
unionpass(self)Make AABB the union of other AABBs.
update_extentspass(self)Update AABB bounding box extents.
vertexpass(self)Return AABB vertices.
assignment(=)Overload =.
aabb_assign_aabbpass(lhs)Operator =.

Subroutines

add_facets

Add facets to AABB.

@note Previously stored facets list is lost.

@note Facets added to AABB are removed to facets list that is also returned.

Attributes: pure

fortran
subroutine add_facets(self, facet_id, facet, is_exclusive)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.
facet_idtype(list_id_object)inoutList of facets IDs.
facettype(facet_object)inFacets list.
is_exclusivelogicalinoptionalSentinel to enable/disable exclusive addition.

Call graph

compute_octants

Return AABB octants.

Attributes: pure

fortran
subroutine compute_octants(self, octant)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
octanttype(aabb_object)outAABB octants.

Call graph

compute_vertices_nearby

Compute vertices nearby.

Attributes: pure

fortran
subroutine compute_vertices_nearby(self, facet, tolerance_to_be_identical, tolerance_to_be_nearby)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
facettype(facet_object)inoutFacets list.
tolerance_to_be_identicalreal(kind=R8P)inTolerance to identify identical vertices.
tolerance_to_be_nearbyreal(kind=R8P)inTolerance to identify nearby vertices.

Call graph

destroy

Destroy AABB.

Attributes: elemental

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.

Call graph

get_aabb_facets

Get AABB facets list.

Attributes: pure

fortran
subroutine get_aabb_facets(self, facet, aabb_facet)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
facettype(facet_object)inWhole facets list.
aabb_facettype(facet_object)outallocatableAABB facets list.

Call graph

initialize

Initialize AABB.

Attributes: pure

fortran
subroutine initialize(self, facet, bmin, bmax)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.
facettype(facet_object)inoptionalFacets list.
bmintype(vector_R8P)inoptionalMinimum point of AABB.
bmaxtype(vector_R8P)inoptionalMaximum point of AABB.

Call graph

save_geometry_tecplot_ascii

Save AABB geometry into Tecplot ascii file.

fortran
subroutine save_geometry_tecplot_ascii(self, file_unit, aabb_name)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
file_unitinteger(kind=I4P)inFile unit.
aabb_namecharacter(len=*)inoptionalName of AABB.

Call graph

save_facets_into_file_stl

Save facets into file STL.

fortran
subroutine save_facets_into_file_stl(self, facet, file_name, is_ascii)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
facettype(facet_object)inFacets list.
file_namecharacter(len=*)inFile name.
is_asciilogicalinSentinel for file format.

Call graph

translate

Translate AABB by delta.

Attributes: elemental

fortran
subroutine translate(self, delta)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.
deltatype(vector_R8P)inDelta of translation.

Call graph

union

Make AABB the union of other AABBs.

Attributes: pure

fortran
subroutine union(self, other)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.
othertype(aabb_object)inOther AABB.

Call graph

update_extents

Update AABB bounding box extents.

Attributes: pure

fortran
subroutine update_extents(self, facet)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inoutAABB.
facettype(facet_object)inFacets list.

Call graph

aabb_assign_aabb

Operator =.

Attributes: pure

fortran
subroutine aabb_assign_aabb(lhs, rhs)

Arguments

NameTypeIntentAttributesDescription
lhsclass(aabb_object)inoutLeft hand side.
rhstype(aabb_object)inRight hand side.

compute_bb_from_facets

Compute AABB extents (minimum and maximum bounding box) from facets list.

@note Facets' metrix must be already computed.

Attributes: pure

fortran
subroutine compute_bb_from_facets(facet, bmin, bmax)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)inFacets list.
bmintype(vector_R8P)inoutMinimum point of AABB.
bmaxtype(vector_R8P)inoutMaximum point of AABB.

Call graph

Functions

closest_point

Return closest point on (or in) AABB from point reference.

Attributes: pure

Returns: type(vector_R8P)

fortran
function closest_point(self, point) result(closest)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
pointtype(vector_R8P)inPoint reference.

Call graph

distance

Return the (square) distance from point to AABB.

Attributes: pure

Returns: real(kind=R8P)

fortran
function distance(self, point)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
pointtype(vector_R8P)inPoint reference.

Call graph

distance_from_facets

Return the (square) distance from point to AABB's facets.

Attributes: pure

Returns: real(kind=R8P)

fortran
function distance_from_facets(self, facet, point) result(distance)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
facettype(facet_object)inFacets list.
pointtype(vector_R8P)inPoint reference.

Call graph

do_ray_intersect

Return true if AABB is intersected by ray from origin and oriented as ray direction vector.

Attributes: pure

Returns: logical

fortran
function do_ray_intersect(self, ray_origin, ray_direction) result(do_intersect)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB box.
ray_origintype(vector_R8P)inRay origin.
ray_directiontype(vector_R8P)inRay direction.

Call graph

has_facets

Return true if AABB has facets.

Attributes: pure

Returns: logical

fortran
function has_facets(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB box.

Call graph

is_inside

Return the true if point is inside ABB.

Attributes: pure

Returns: logical

fortran
function is_inside(self, point)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
pointtype(vector_R8P)inPoint reference.

Call graph

median

Return the median of AABB.

Attributes: pure

Returns: real(kind=R8P)

fortran
function median(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.

Call graph

ray_intersections_number

Return ray intersections number.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function ray_intersections_number(self, facet, ray_origin, ray_direction) result(intersections_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.
facettype(facet_object)inFacets list.
ray_origintype(vector_R8P)inRay origin.
ray_directiontype(vector_R8P)inRay direction.

Call graph

vertex

Return AABB vertices.

Attributes: pure

Returns: type(vector_R8P)

fortran
function vertex(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(aabb_object)inAABB.

Call graph