3D model file I/O based on Assimp More...
Classes | |
| struct | Material |
| struct | ExportOptions |
Functions | |
| MeshGL | ImportMesh (const std::string &filename, bool forceCleanup=false) |
| void | ExportMesh (const std::string &filename, const MeshGL &mesh, const ExportOptions &options) |
3D model file I/O based on Assimp
| struct manifold::Material |
PBR material properties for GLB/glTF files.
| struct manifold::ExportOptions |
These options only currently affect .glb and .gltf files.
| Class Members | ||
|---|---|---|
| bool | faceted = true |
When false, vertex normals are exported, causing the mesh to appear smooth through normal interpolation. |
| Material | mat = {} | PBR material properties. |
| MeshGL ImportMesh | ( | const std::string & | filename, |
| bool | forceCleanup ) |
Imports the given file as a Mesh structure, which can be converted to a Manifold if the mesh is a proper oriented 2-manifold. Any supported polygon format will be automatically triangulated.
This is a very simple import function and is intended primarily as a demonstration. Generally users of this library will need to modify this to read all the important properties for their application and set up any custom data structures.
| filename | Supports any format the Assimp library supports. |
| forceCleanup | This merges identical vertices, which can break manifoldness. However it is always done for STLs, as they cannot possibly be manifold without this step. |
| void ExportMesh | ( | const std::string & | filename, |
| const MeshGL & | mesh, | ||
| const ExportOptions & | options ) |
Saves the Mesh to the desired file type, determined from the extension specified. In the case of .glb/.gltf, this will save in version 2.0.
This is a very simple export function and is intended primarily as a demonstration. Generally users of this library will need to modify this to write all the important properties for their application and read any custom data structures.
| filename | The file extension must be one that Assimp supports for export. GLB & 3MF are recommended. |
| mesh | The mesh to export, likely from Manifold.GetMeshGL(). |
| options | The options currently only affect an exported GLB's material. Pass {} for defaults. |