|
scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
|
Functions for reading and writing STL files. More...
Functions | |
| Mesh | read_stl (const std::string &path) |
| Load a mesh from an STL file (ASCII or binary). | |
| void | write_stl_binary (const std::string &path, const Mesh &mesh) |
| Write a mesh to a binary STL file. | |
| void | write_stl_ascii (const std::string &path, const Mesh &mesh) |
| Write a mesh to an ASCII STL file. | |
| void | write_stl (const std::string &path, const Mesh &mesh, const std::string &format) |
| Write a mesh to an STL file, choosing the format. | |
Functions for reading and writing STL files.
|
inline |
Load a mesh from an STL file (ASCII or binary).
STL files contain only raw triangle geometry — each triangle is stored independently with its own vertices (no indexed face set sharing). Colors and normals are not stored in STL files.
| path | Filesystem path to the .stl file. |
| std::runtime_error | if the file cannot be opened or parsed. |
mesh.default_color or populate mesh.colors manually for rendering.
|
inline |
Write a mesh to an STL file, choosing the format.
| path | Output file path. |
| mesh | The mesh to write. |
| format | Either "binary" (compact, recommended) or "ascii" (human-readable but large). |
| std::runtime_error | if the file cannot be created. |
|
inline |
Write a mesh to an ASCII STL file.
ASCII STL is human-readable (you can open it in a text editor) but much larger than binary STL.
| path | Output file path. |
| mesh | The mesh to write. |
| std::runtime_error | if the file cannot be created. |
|
inline |
Write a mesh to a binary STL file.
Binary STL is more compact than ASCII. The file begins with an 80-byte header followed by a triangle count and per-triangle data.
| path | Output file path. |
| mesh | The mesh to write. |
| std::runtime_error | if the file cannot be created. |