FOSSIL, STL file class definition.
FOSSIL STL file class.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | file_name | File name |
||
| integer(kind=I4P), | public | :: | file_unit | = | 0 | File unit. |
|
| character(len=FRLEN), | public | :: | header | File header. |
|||
| integer(kind=I4P), | public | :: | facets_number | = | 0 | Facets number. |
|
| type(facet_object), | public, | allocatable | :: | facet(:) | Facets. |
||
| type(aabb_tree_object), | public | :: | aabb | AABB tree. |
|||
| type(vector_R8P), | public | :: | bmin | Minimum point of STL. |
|||
| type(vector_R8P), | public | :: | bmax | Maximum point of STL. |
|||
| real(kind=R8P), | public | :: | volume | = | 0._R8P | Volume bounded by STL surface. |
|
| logical, | public | :: | is_ascii | = | .true. | Sentinel to check if file is ASCII. |
|
| logical, | public | :: | is_open | = | .false. | Sentinel to check if file is open. |
| procedure, public, pass(self) :: analize | Analize STL. |
| procedure, public, pass(self) :: build_connectivity | Build facets connectivity. |
| procedure, public, pass(self) :: close_file | Close file. |
| procedure, public, pass(self) :: compute_metrix | Compute facets metrix. |
| procedure, public, pass(self) :: compute_normals | Compute facets normals by means of vertices data. |
| procedure, public, pass(self) :: compute_volume | Compute volume bounded by STL surface. |
| procedure, public, pass(self) :: create_aabb_tree | Create the AABB tree. |
| procedure, public, pass(self) :: destroy | Destroy file. |
| procedure, public, pass(self) :: distance | Compute the (minimum) distance from point to triangulated surface. |
| procedure, public, pass(self) :: initialize | Initialize file. |
| procedure, public, pass(self) :: is_point_inside_polyhedron_ri | Determinate is point is inside or not STL facets by ray intersect. |
| procedure, public, pass(self) :: is_point_inside_polyhedron_sa | Determinate is point is inside or not STL facets by solid angle. |
| procedure, public, pass(self) :: load_from_file | Load from file. |
| generic, public :: mirror => mirror_by_normal, mirror_by_matrix | Mirror facets. |
| procedure, public, pass(self) :: open_file | Open file, once initialized. |
| procedure, public, pass(self) :: reverse_normals | Reverse facets normals. |
| procedure, public, pass(self) :: resize | Resize (scale) facets by x or y or z or vectorial factors. |
| generic, public :: rotate => rotate_by_axis_angle, rotate_by_matrix | Rotate facets. |
| procedure, public, pass(self) :: sanitize_normals | Sanitize facets normals, make them consistent. |
| procedure, public, pass(self) :: save_into_file | Save into file. |
| procedure, public, pass(self) :: statistics | Return STL statistics. |
| procedure, public, pass(self) :: translate | Translate facet given vectorial delta. |
| generic, public :: assignment(=) => file_stl_assign_file_stl | Overload |
| procedure, private, pass(lhs) :: file_stl_assign_file_stl | Operator |
| procedure, private, pass(self) :: allocate_facets | Allocate facets. |
| procedure, private, pass(self) :: load_facets_number_from_file | Load facets number from file. |
| procedure, private, pass(self) :: load_header_from_file | Load header from file. |
| procedure, private, pass(self) :: mirror_by_normal | Mirror facets given normal of mirroring plane. |
| procedure, private, pass(self) :: mirror_by_matrix | Mirror facets given matrix. |
| procedure, private, pass(self) :: rotate_by_axis_angle | Rotate facets given axis and angle. |
| procedure, private, pass(self) :: rotate_by_matrix | Rotate facets given matrix. |
| procedure, private, pass(self) :: save_header_into_file | Save header into file. |
| procedure, private, pass(self) :: save_trailer_into_file | Save trailer into file. |
Compute the (minimum) distance from a point to the triangulated surface.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(in) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | point | Point coordinates. |
||
| logical, | intent(in), | optional | :: | is_signed | Sentinel to trigger signed distance. |
|
| character(len=*), | intent(in), | optional | :: | sign_algorithm | Algorithm used for "point in polyhedron" test. |
|
| logical, | intent(in), | optional | :: | is_square_root | Sentinel to trigger square-root distance. |
Minimum distance from point to the triangulated surface.
Determinate is a point is inside or not to a polyhedron described by STL facets by means ray intersections count.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(in) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | point | Point coordinates. |
Check result.
Determinate is a point is inside or not to a polyhedron described by STL facets by means of the solid angle criteria.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(in) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | point | Point coordinates. |
Check result.
Return STL statistics.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(in) | :: | self | File STL. |
||
| character(len=*), | intent(in), | optional | :: | prefix | Lines prefix. |
STL statistics.
Analize STL.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Build facets connectivity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Close file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Compute facets metrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Compute facets normals by means of vertices data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Compute volume bounded by STL surface.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Create AABB tree.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| integer(kind=I4P), | intent(in), | optional | :: | refinement_levels | Total number of refinement levels used. |
Destroy file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Initialize file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| logical, | intent(in), | optional | :: | skip_destroy | Flag to skip destroy file. |
|
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
| logical, | intent(in), | optional | :: | is_ascii | Sentinel to check if file is ASCII. |
Load from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
| logical, | intent(in), | optional | :: | is_ascii | Sentinel to check if file is ASCII. |
|
| logical, | intent(in), | optional | :: | guess_format | Sentinel to try to guess format directly from file. |
|
| logical, | intent(in), | optional | :: | disable_analysis | Sentinel to disable STL analysis. |
Open file, once initialized.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| character(len=*), | intent(in) | :: | file_action | File action, "read" or "write". |
||
| logical, | intent(in), | optional | :: | guess_format | Sentinel to try to guess format directly from file. |
Reverse facets normals.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Sanitize facets normals, make them consistent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Save into file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
| logical, | intent(in), | optional | :: | is_ascii | Sentinel to check if file is ASCII. |
Resize (scale) facets by x or y or z or vectorial factors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| real(kind=R8P), | intent(in), | optional | :: | x | Factor along x axis. |
|
| real(kind=R8P), | intent(in), | optional | :: | y | Factor along y axis. |
|
| real(kind=R8P), | intent(in), | optional | :: | z | Factor along z axis. |
|
| type(vector_R8P), | intent(in), | optional | :: | factor | Vectorial factor. |
|
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Translate facets x or y or z or vectorial delta increments.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| real(kind=R8P), | intent(in), | optional | :: | x | Increment along x axis. |
|
| real(kind=R8P), | intent(in), | optional | :: | y | Increment along y axis. |
|
| real(kind=R8P), | intent(in), | optional | :: | z | Increment along z axis. |
|
| type(vector_R8P), | intent(in), | optional | :: | delta | Vectorial increment. |
|
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Operator =.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | lhs | Left hand side. |
||
| type(file_stl_object), | intent(in) | :: | rhs | Right hand side. |
Allocate facets.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Load facets number from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Load header from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Mirror facets given normal of mirroring plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | normal | Normal of mirroring plane. |
||
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Mirror facet given matrix (of mirroring).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| real(kind=R8P), | intent(in) | :: | matrix(3,3) | Mirroring matrix. |
||
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Rotate facets given axis and angle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | axis | Axis of rotation. |
||
| real(kind=R8P), | intent(in) | :: | angle | Angle of rotation. |
||
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Rotate facet given matrix (of ratation).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| real(kind=R8P), | intent(in) | :: | matrix(3,3) | Rotation matrix. |
||
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
Save header into file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
Save trailer into file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |