STL Reader
| Stereo Lithography (STL) | ||
| File Extension | STL | |
| Supported Versions | Any | |
| Platforms | ||
| Tessellation | Read from file | |
| B-rep | N/A | |
| PMI | N/A | |
STL (STereoLithography) is a widely-used file format for representing 3D surface geometry, originally developed by 3D Systems. The format was created to bridge the gap between CAD software and 3D printers, allowing 3D model data to be described as a mesh of triangles for additive manufacturing.
This format is commonly employed in various industries such as manufacturing, engineering, architecture, and entertainment for creating and exchanging 3D models.
The STL format describes the surface geometry of a 3D object using a collection of triangular facets, providing a simple and efficient representation of complex shapes.
This format is particularly suitable for applications requiring rapid prototyping, computer-aided design (CAD), and 3D printing.
Our support for STL covers reading and writing any version of the STL file format for Windows, GNU/Linux and macOS.
As a tessellation-only format, we only import tessellation data.
How to Import from STL
If you are new to reading models with HOOPS Exchange, see the basic load workflow section of the Programming Guide.
To load an STL file, use A3DAsmModelFileLoadFromFile().
Below, the A3DRWParamsLoadData structure is used to customize the loading behavior. See our API reference manual for more information about this important data type.
A3DAsmModelFile* pModelFile = 0;
A3DRWParamsLoadData sReadParam;
A3D_INITIALIZE_DATA(A3DRWParamsLoadData, sReadParam);
sReadParam.m_sGeneral.m_bReadSolids = true;
// ... set other A3DRWParamsLoadData fields as necessary
A3DAsmModelFileLoadFromFile("path/to/file.stl", &sReadParam, &pModelFile);
Upon reading, use A3DRWParamsGeneralData::m_eReadGeomTessMode to decide whether tessellation is read.
The A3DRWParamsLoadData::m_sTessellation member is used to decide how this is performed.
See Simple Load and Export for general information about loading model files.
Tessellation
Tessellation information is directly read from the source without additional treatment.
For more information about tessellation in HOOPS Exchange, see Reading Tessellation.
Assembly
STL files may contain multiple components or objects. HOOPS Exchange represents these as a model tree that you can traverse using the standard structure APIs.
To learn more about how HOOPS Exchange handles assemblies, see our tutorial about assembly traversal.