Appearance
fossil_surface_stl_object
FOSSIL, STL surface class definition.
Source: src/lib/fossil_surface_stl.f90
Dependencies
Contents
- surface_stl_object
- allocate_facets
- analize
- build_connectivity
- clip
- compute_centroid
- compute_distance
- compute_mesh_distance
- compute_metrix
- compute_normals
- compute_volume
- connect_nearby_vertices
- destroy
- initialize
- merge_solids
- resize
- reverse_normals
- sanitize
- sanitize_normals
- translate
- surface_stl_assign_surface_stl
- compute_facets_disconnected
- mirror_by_normal
- mirror_by_matrix
- rotate_by_axis_angle
- rotate_by_matrix
- set_facets_id
- distance
- is_point_inside
- is_point_inside_polyhedron_ri
- is_point_inside_polyhedron_sa
- largest_edge_len
- smallest_edge_len
- statistics
Derived Types
surface_stl_object
FOSSIL STL surface class.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
facets_number | integer(kind=I4P) | Facets number. | |
facet | type(facet_object) | allocatable | Facets. |
facet_1_de | type(list_id_object) | Facets with one disconnected edges. | |
facet_2_de | type(list_id_object) | Facets with two disconnected edges. | |
facet_3_de | type(list_id_object) | Facets with three disconnected edges. | |
aabb | type(aabb_tree_object) | AABB tree. | |
bmin | type(vector_R8P) | Minimum point of STL. | |
bmax | type(vector_R8P) | Maximum point of STL. | |
volume | real(kind=R8P) | Volume bounded by STL surface. | |
centroid | type(vector_R8P) | Centroid of STL surface. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
allocate_facets | pass(self) | Allocate facets. |
analize | pass(self) | Analize STL. |
build_connectivity | pass(self) | Build facets connectivity. |
clip | pass(self) | Clip triangulated surface given an AABB. |
compute_centroid | pass(self) | Compute centroid of STL surface. |
compute_distance | pass(self) | Compute the (minimum) distance returning also the closest point. |
compute_mesh_distance | pass(self) | Compute the (minimum) distance in a given mesh. |
compute_metrix | pass(self) | Compute facets metrix. |
compute_normals | pass(self) | Compute facets normals by means of vertices data. |
compute_volume | pass(self) | Compute volume bounded by STL surface. |
connect_nearby_vertices | pass(self) | Connect nearby vertices of disconnected edges. |
destroy | pass(self) | Destroy file. |
distance | pass(self) | Return the (minimum) distance from point to triangulated surface. |
initialize | pass(self) | Initialize file. |
is_point_inside | pass(self) | Determinate if point is inside or not STL. |
is_point_inside_polyhedron_ri | pass(self) | Determinate if point is inside or not STL facets by ray intersect. |
is_point_inside_polyhedron_sa | pass(self) | Determinate if point is inside or not STL facets by solid angle. |
largest_edge_len | pass(self) | Return the largest edge length. |
merge_solids | pass(self) | Merge facets with ones of other STL file. |
mirror | Mirror facets. | |
reverse_normals | pass(self) | Reverse facets normals. |
resize | pass(self) | Resize (scale) facets by x or y or z or vectorial factors. |
rotate | Rotate facets. | |
sanitize | pass(self) | Sanitize STL. |
sanitize_normals | pass(self) | Sanitize facets normals, make them consistent. |
smallest_edge_len | pass(self) | Return the smallest edge length. |
statistics | pass(self) | Return STL statistics. |
translate | pass(self) | Translate facet given vectorial delta. |
assignment(=) | Overload =. | |
surface_stl_assign_surface_stl | pass(lhs) | Operator =. |
compute_facets_disconnected | pass(self) | Compute facets with disconnected edges. |
mirror_by_normal | pass(self) | Mirror facets given normal of mirroring plane. |
mirror_by_matrix | pass(self) | Mirror facets given matrix. |
rotate_by_axis_angle | pass(self) | Rotate facets given axis and angle. |
rotate_by_matrix | pass(self) | Rotate facets given matrix. |
set_facets_id | pass(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
facets_number | integer(kind=I4P) | in | Facets number. |
Call graph
analize
Analize STL.
Buil connectivity, compute metrix, compute volume.
fortran
subroutine analize(self, aabb_refinement_levels)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
aabb_refinement_levels | integer(kind=I4P) | in | optional | AABB refinement levels. |
Call graph
build_connectivity
Build facets connectivity.
fortran
subroutine build_connectivity(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
clip
Clip triangulated surface given an AABB.
fortran
subroutine clip(self, bmin, bmax, remainder)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
bmin | type(vector_R8P) | in | Bounding box extents. | |
bmax | type(vector_R8P) | in | Bounding box extents. | |
remainder | type(surface_stl_object) | out | optional | Remainder 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
point | type(vector_R8P) | in | Point coordinates. | |
distance | real(kind=R8P) | out | Minimum distance. | |
is_signed | logical | in | optional | Sentinel to trigger signed distance. |
sign_algorithm | character(len=*) | in | optional | Algorithm used for "point in polyhedron" test. |
is_square_root | logical | in | optional | Sentinel to trigger square-root distance. |
facet_index | integer(kind=I4P) | out | optional | Index of facet containing the closest point. |
edge_index | integer(kind=I4P) | out | optional | Index of edge on facet containing the closest point. |
vertex_index | integer(kind=I4P) | out | optional | Index 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
mesh | type(vector_R8P) | in | Mesh coordinates [1:ni,1:nj,1:nk]. | |
distance | real(kind=R8P) | out | Minimum distance. | |
is_signed | logical | in | optional | Sentinel to trigger signed distance. |
sign_algorithm | character(len=*) | in | optional | Algorithm used for "point in polyhedron" test. |
is_square_root | logical | in | optional | Sentinel to trigger square-root distance. |
Call graph
compute_metrix
Compute facets metrix.
Attributes: pure
fortran
subroutine compute_metrix(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
compute_normals
Compute facets normals by means of vertices data.
Attributes: elemental
fortran
subroutine compute_normals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
compute_volume
Compute volume bounded by STL surface.
Attributes: elemental
fortran
subroutine compute_volume(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
connect_nearby_vertices
Connect nearby vertices of disconnected edges.
Attributes: pure
fortran
subroutine connect_nearby_vertices(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
destroy
Destroy file.
Attributes: elemental
fortran
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
initialize
Initialize file.
Attributes: elemental
fortran
subroutine initialize(self, aabb_refinement_levels)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
aabb_refinement_levels | integer(kind=I4P) | in | optional | AABB refinement levels. |
Call graph
merge_solids
Merge facets with ones of other STL file.
fortran
subroutine merge_solids(self, other)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
other | type(surface_stl_object) | in | Other 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
x | real(kind=R8P) | in | optional | Factor along x axis. |
y | real(kind=R8P) | in | optional | Factor along y axis. |
z | real(kind=R8P) | in | optional | Factor along z axis. |
factor | type(vector_R8P) | in | optional | Vectorial factor. |
respect_centroid | logical | in | optional | Sentinel to activate centroid as resize center. |
recompute_metrix | logical | in | optional | Sentinel to activate metrix recomputation. |
Call graph
reverse_normals
Reverse facets normals.
Attributes: elemental
fortran
subroutine reverse_normals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. |
Call graph
sanitize
Sanitize STL.
fortran
subroutine sanitize(self, do_analysis)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
do_analysis | logical | in | optional | Sentil 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
x | real(kind=R8P) | in | optional | Increment along x axis. |
y | real(kind=R8P) | in | optional | Increment along y axis. |
z | real(kind=R8P) | in | optional | Increment along z axis. |
delta | type(vector_R8P) | in | optional | Vectorial increment. |
recompute_metrix | logical | in | optional | Sentinel to activate metrix recomputation. |
Call graph
surface_stl_assign_surface_stl
Operator =.
Attributes: pure
fortran
subroutine surface_stl_assign_surface_stl(lhs, rhs)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
lhs | class(surface_stl_object) | inout | Left hand side. | |
rhs | type(surface_stl_object) | in | Right hand side. |
Call graph
compute_facets_disconnected
Compute facets with disconnected edges.
Attributes: pure
fortran
subroutine compute_facets_disconnected(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
normal | type(vector_R8P) | in | Normal of mirroring plane. | |
recompute_metrix | logical | in | optional | Sentinel 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
matrix | real(kind=R8P) | in | Mirroring matrix. | |
recompute_metrix | logical | in | optional | Sentinel 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
axis | type(vector_R8P) | in | Axis of rotation. | |
angle | real(kind=R8P) | in | Angle of rotation. | |
recompute_metrix | logical | in | optional | Sentinel 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File STL. | |
matrix | real(kind=R8P) | in | Rotation matrix. | |
recompute_metrix | logical | in | optional | Sentinel to activate metrix recomputation. |
Call graph
set_facets_id
(Re)set facets ID.
Attributes: elemental
fortran
subroutine set_facets_id(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | inout | File 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
point | type(vector_R8P) | in | Point coordinates. | |
is_signed | logical | in | optional | Sentinel to trigger signed distance. |
sign_algorithm | character(len=*) | in | optional | Algorithm used for "point in polyhedron" test. |
is_square_root | logical | in | optional | Sentinel 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
point | type(vector_R8P) | in | Point coordinates. | |
sign_algorithm | character(len=*) | in | optional | Algorithm 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
point | type(vector_R8P) | in | Point 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
point | type(vector_R8P) | in | Point 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. |
Call graph
statistics
Return STL statistics.
Attributes: pure
Returns: character(len=:)
fortran
function statistics(self, prefix) result(stats)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(surface_stl_object) | in | File STL. | |
prefix | character(len=*) | in | optional | Lines prefix. |
Call graph