tem_stlb_io_module Module

This module provides functionality for reading and writing stl files.



Subroutines

public subroutine tem_size_stlb(filename, nNodes, nTris)

This subroutine reads the number of nodes and triangles from a given binary stl file.

Arguments

Type IntentOptional Attributes Name
character(len=PathLen), intent(in) :: filename

name of the binary stl file

integer, intent(out) :: nNodes

number of nodes in the file

integer, intent(out) :: nTris

number of triangles in the file

public subroutine tem_read_stlb(filename, nNodesRead, nTrisRead, nodes, tri_node, iError)

This routine actually reads the data (points, triangles, normals) from the binary file and stores them.

Arguments

Type IntentOptional Attributes Name
character(len=PathLen), intent(in) :: filename

name of the binary stl file

integer, intent(in) :: nNodesRead

Number of nodes read from the file header, to compare against the actual number of nodes read

integer, intent(in) :: nTrisRead

Number of triangles read from the file header, to compare against the actual number of triangles read

real(kind=rk), intent(out) :: nodes(:,:)

point coordinates read from the stl-file size: 3, nPoints_total

integer, intent(out) :: tri_node(:,:)

connectivity array for the triangles size: 3, nTriangles_total

integer, intent(out) :: iError

error while openeing the file, or if the number of nodes/trias do not match to the ones read from the header (if error -> iError > 0)

public subroutine tem_dump_stlb(outprefix, nodes, triangles, proc, header, normals, time, timeformatter)

This routine dumps a set of nodes and triangles to disc.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: outprefix

output prefix for the filename

real(kind=rk), intent(in) :: nodes(:)

nodes to be dumped (size: 3*nNodes)

integer, intent(in) :: triangles(:,:)

triangles to be dumped (size: 3, nTrias)

type(tem_comm_env_type), intent(in) :: proc

process description to use

character(len=80), intent(in), optional :: header

optional header to be dumped

real(kind=rk), intent(in), optional :: normals(:,:)

optional array of normals, if not passed normals will be calculated internally

type(tem_time_type), intent(in), optional :: time

optional simulation time to be appended to the filename

type(tem_timeformatter_type), intent(in), optional :: timeformatter

optional formatter for the timestamp