Applications commonly need to read a mesh file from disk. Quest provides the STLReader
class, which can read binary or ASCII STL files, as well as the PSTLReader
class for use in parallel codes. STL (stereolithography) is a common file format for triangle surface meshes. The STL reader classes will read the file from disk and build a mint::Mesh
object.
The code examples are excerpts from the file <axom>/src/tools/mesh_tester.cpp
.
We include the STL reader header
../../../../tools/mesh_tester.cpp
and also the mint Mesh and UnstructuredMesh headers.
../../../../tools/mesh_tester.cpp
For convenience, we use typedefs in the axom namespace.
../../../../tools/mesh_tester.cpp
The following example shows usage of the STLReader class:
../../../../tools/mesh_tester.cpp
After reading the STL file, the STLReader::getMesh
method gives access to the underlying mesh data. The reader may then be deleted.