Skip to content

fossil_surface_stl_object

FOSSIL, STL surface class definition.

Source: src/lib/fossil_surface_stl.f90

Dependencies

Contents

Derived Types

surface_stl_object

FOSSIL STL surface class.

Components

NameTypeAttributesDescription
facets_numberinteger(kind=I4P)Facets number.
facettype(facet_object)allocatableFacets.
facet_1_detype(list_id_object)Facets with one disconnected edges.
facet_2_detype(list_id_object)Facets with two disconnected edges.
facet_3_detype(list_id_object)Facets with three disconnected edges.
aabbtype(aabb_tree_object)AABB tree.
bmintype(vector_R8P)Minimum point of STL.
bmaxtype(vector_R8P)Maximum point of STL.
volumereal(kind=R8P)Volume bounded by STL surface.
centroidtype(vector_R8P)Centroid of STL surface.

Type-Bound Procedures

NameAttributesDescription
allocate_facetspass(self)Allocate facets.
analizepass(self)Analize STL.
build_connectivitypass(self)Build facets connectivity.
clippass(self)Clip triangulated surface given an AABB.
compute_centroidpass(self)Compute centroid of STL surface.
compute_distancepass(self)Compute the (minimum) distance returning also the closest point.
compute_mesh_distancepass(self)Compute the (minimum) distance in a given mesh.
compute_metrixpass(self)Compute facets metrix.
compute_normalspass(self)Compute facets normals by means of vertices data.
compute_volumepass(self)Compute volume bounded by STL surface.
connect_nearby_verticespass(self)Connect nearby vertices of disconnected edges.
destroypass(self)Destroy file.
distancepass(self)Return the (minimum) distance from point to triangulated surface.
initializepass(self)Initialize file.
is_point_insidepass(self)Determinate if point is inside or not STL.
is_point_inside_polyhedron_ripass(self)Determinate if point is inside or not STL facets by ray intersect.
is_point_inside_polyhedron_sapass(self)Determinate if point is inside or not STL facets by solid angle.
largest_edge_lenpass(self)Return the largest edge length.
merge_solidspass(self)Merge facets with ones of other STL file.
mirrorMirror facets.
reverse_normalspass(self)Reverse facets normals.
resizepass(self)Resize (scale) facets by x or y or z or vectorial factors.
rotateRotate facets.
sanitizepass(self)Sanitize STL.
sanitize_normalspass(self)Sanitize facets normals, make them consistent.
smallest_edge_lenpass(self)Return the smallest edge length.
statisticspass(self)Return STL statistics.
translatepass(self)Translate facet given vectorial delta.
assignment(=)Overload =.
surface_stl_assign_surface_stlpass(lhs)Operator =.
compute_facets_disconnectedpass(self)Compute facets with disconnected edges.
mirror_by_normalpass(self)Mirror facets given normal of mirroring plane.
mirror_by_matrixpass(self)Mirror facets given matrix.
rotate_by_axis_anglepass(self)Rotate facets given axis and angle.
rotate_by_matrixpass(self)Rotate facets given matrix.
set_facets_idpass(self)(Re)set facets ID.

Subroutines

allocate_facets

Allocate facets.

@note Facets previously allocated are lost.

Attributes: elemental

fortran
subroutine allocate_facets(self, facets_number)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
facets_numberinteger(kind=I4P)inFacets number.

Call graph

analize

Analize STL.

Buil connectivity, compute metrix, compute volume.

fortran
subroutine analize(self, aabb_refinement_levels)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
aabb_refinement_levelsinteger(kind=I4P)inoptionalAABB refinement levels.

Call graph

build_connectivity

Build facets connectivity.

fortran
subroutine build_connectivity(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

clip

Clip triangulated surface given an AABB.

fortran
subroutine clip(self, bmin, bmax, remainder)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
bmintype(vector_R8P)inBounding box extents.
bmaxtype(vector_R8P)inBounding box extents.
remaindertype(surface_stl_object)outoptionalRemainder part of the triangulated surface.

Call graph

compute_centroid

Compute centroid of STL surface.

@note Metrix and volume must be already computed.

Attributes: pure

fortran
subroutine compute_centroid(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

compute_distance

Compute the (minimum) distance returning also the closest point.

fortran
subroutine compute_distance(self, point, distance, is_signed, sign_algorithm, is_square_root, facet_index, edge_index, vertex_index)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
pointtype(vector_R8P)inPoint coordinates.
distancereal(kind=R8P)outMinimum distance.
is_signedlogicalinoptionalSentinel to trigger signed distance.
sign_algorithmcharacter(len=*)inoptionalAlgorithm used for "point in polyhedron" test.
is_square_rootlogicalinoptionalSentinel to trigger square-root distance.
facet_indexinteger(kind=I4P)outoptionalIndex of facet containing the closest point.
edge_indexinteger(kind=I4P)outoptionalIndex of edge on facet containing the closest point.
vertex_indexinteger(kind=I4P)outoptionalIndex of vertex on facet containing the closest point.

Call graph

compute_mesh_distance

Compute the (minimum) distance in a given mesh.

fortran
subroutine compute_mesh_distance(self, mesh, distance, is_signed, sign_algorithm, is_square_root)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
meshtype(vector_R8P)inMesh coordinates [1:ni,1:nj,1:nk].
distancereal(kind=R8P)outMinimum distance.
is_signedlogicalinoptionalSentinel to trigger signed distance.
sign_algorithmcharacter(len=*)inoptionalAlgorithm used for "point in polyhedron" test.
is_square_rootlogicalinoptionalSentinel to trigger square-root distance.

Call graph

compute_metrix

Compute facets metrix.

Attributes: pure

fortran
subroutine compute_metrix(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

compute_normals

Compute facets normals by means of vertices data.

Attributes: elemental

fortran
subroutine compute_normals(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

compute_volume

Compute volume bounded by STL surface.

Attributes: elemental

fortran
subroutine compute_volume(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

connect_nearby_vertices

Connect nearby vertices of disconnected edges.

Attributes: pure

fortran
subroutine connect_nearby_vertices(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

destroy

Destroy file.

Attributes: elemental

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

initialize

Initialize file.

Attributes: elemental

fortran
subroutine initialize(self, aabb_refinement_levels)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
aabb_refinement_levelsinteger(kind=I4P)inoptionalAABB refinement levels.

Call graph

merge_solids

Merge facets with ones of other STL file.

fortran
subroutine merge_solids(self, other)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
othertype(surface_stl_object)inOther file STL.

Call graph

resize

Resize (scale) facets by x or y or z or vectorial factors.

@note The name scale has not been used, it been a Fortran built-in.

@note If centroid must be used for center of resize it must be already computed.

Attributes: elemental

fortran
subroutine resize(self, x, y, z, factor, respect_centroid, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
xreal(kind=R8P)inoptionalFactor along x axis.
yreal(kind=R8P)inoptionalFactor along y axis.
zreal(kind=R8P)inoptionalFactor along z axis.
factortype(vector_R8P)inoptionalVectorial factor.
respect_centroidlogicalinoptionalSentinel to activate centroid as resize center.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

reverse_normals

Reverse facets normals.

Attributes: elemental

fortran
subroutine reverse_normals(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

sanitize

Sanitize STL.

fortran
subroutine sanitize(self, do_analysis)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
do_analysislogicalinoptionalSentil for performing a first analysis.

Call graph

sanitize_normals

Sanitize facets normals, make them consistent.

@note Facets connectivity and normals must be already computed.

Attributes: pure

fortran
subroutine sanitize_normals(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

translate

Translate facets x or y or z or vectorial delta increments.

Attributes: elemental

fortran
subroutine translate(self, x, y, z, delta, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
xreal(kind=R8P)inoptionalIncrement along x axis.
yreal(kind=R8P)inoptionalIncrement along y axis.
zreal(kind=R8P)inoptionalIncrement along z axis.
deltatype(vector_R8P)inoptionalVectorial increment.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

surface_stl_assign_surface_stl

Operator =.

Attributes: pure

fortran
subroutine surface_stl_assign_surface_stl(lhs, rhs)

Arguments

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

Call graph

compute_facets_disconnected

Compute facets with disconnected edges.

Attributes: pure

fortran
subroutine compute_facets_disconnected(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

mirror_by_normal

Mirror facets given normal of mirroring plane.

Attributes: elemental

fortran
subroutine mirror_by_normal(self, normal, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
normaltype(vector_R8P)inNormal of mirroring plane.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

mirror_by_matrix

Mirror facet given matrix (of mirroring).

Attributes: pure

fortran
subroutine mirror_by_matrix(self, matrix, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
matrixreal(kind=R8P)inMirroring matrix.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

rotate_by_axis_angle

Rotate facets given axis and angle.

Angle must be in radiants.

Attributes: elemental

fortran
subroutine rotate_by_axis_angle(self, axis, angle, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
axistype(vector_R8P)inAxis of rotation.
anglereal(kind=R8P)inAngle of rotation.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

rotate_by_matrix

Rotate facet given matrix (of ratation).

Attributes: pure

fortran
subroutine rotate_by_matrix(self, matrix, recompute_metrix)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.
matrixreal(kind=R8P)inRotation matrix.
recompute_metrixlogicalinoptionalSentinel to activate metrix recomputation.

Call graph

set_facets_id

(Re)set facets ID.

Attributes: elemental

fortran
subroutine set_facets_id(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inoutFile STL.

Call graph

Functions

distance

Return the (minimum) distance from a point to the triangulated surface.

@note STL's metrix must be already computed.

Returns: real(kind=R8P)

fortran
function distance(self, point, is_signed, sign_algorithm, is_square_root)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
pointtype(vector_R8P)inPoint coordinates.
is_signedlogicalinoptionalSentinel to trigger signed distance.
sign_algorithmcharacter(len=*)inoptionalAlgorithm used for "point in polyhedron" test.
is_square_rootlogicalinoptionalSentinel to trigger square-root distance.

Call graph

is_point_inside

Compute sign.

Returns: logical

fortran
function is_point_inside(self, point, sign_algorithm) result(is_inside)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
pointtype(vector_R8P)inPoint coordinates.
sign_algorithmcharacter(len=*)inoptionalAlgorithm used for "point in polyhedron" test.

Call graph

is_point_inside_polyhedron_ri

Determinate is a point is inside or not to a polyhedron described by STL facets by means ray intersections count.

@note STL's metrix must be already computed.

Returns: logical

fortran
function is_point_inside_polyhedron_ri(self, point) result(is_inside)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
pointtype(vector_R8P)inPoint coordinates.

Call graph

is_point_inside_polyhedron_sa

Determinate is a point is inside or not to a polyhedron described by STL facets by means of the solid angle criteria.

@note STL's metrix must be already computed.

Attributes: pure

Returns: logical

fortran
function is_point_inside_polyhedron_sa(self, point) result(is_inside)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
pointtype(vector_R8P)inPoint coordinates.

Call graph

largest_edge_len

Return the largest edge length.

Attributes: pure

Returns: real(kind=R8P)

fortran
function largest_edge_len(self) result(largest)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.

Call graph

smallest_edge_len

Return the smallest edge length.

Attributes: pure

Returns: real(kind=R8P)

fortran
function smallest_edge_len(self) result(smallest)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.

Call graph

statistics

Return STL statistics.

Attributes: pure

Returns: character(len=:)

fortran
function statistics(self, prefix) result(stats)

Arguments

NameTypeIntentAttributesDescription
selfclass(surface_stl_object)inFile STL.
prefixcharacter(len=*)inoptionalLines prefix.

Call graph