![]() |
ImFusion SDK 4.3
|
Mesh input/output to standard mesh formats. More...
Mesh input/output to standard mesh formats.
Please note that a mesh is loaded as is, i.e. duplicate vertices are not removed. A user might need to remove duplicate vertices to be able to use some mesh processing functionality
Functions | |
Mesh * | load (const char *buffer, size_t bufferLength, const std::string &sourceFilename="", Progress *progressBar=nullptr, bool log=false) |
Loads a mesh from a memory buffer. | |
Mesh * | load (const std::string &filename, Progress *progressBar=nullptr, bool log=false, bool allowVertexOnlyMesh=false, bool forceNoChecks=false, bool abortOnFaceAddFailure=false) |
Generic method to load a mesh from a file Supports the following file extensions: stl, off, vtk, ply, obj, surf, grid, 3mf. | |
Mesh * | loadFromSTL (const std::string &filename, bool mergeVertices=true) |
Loads a mesh from a STL file, automatically determining text or binary format. | |
Mesh * | loadFromSTL (std::istream &binaryStream, bool mergeVertices=true) |
Mesh * | loadFromOFF (const std::string &filename, bool allowVertexOnlyMesh) |
Loads a mesh from an OFF file. | |
Mesh * | loadFromOFF (std::istream &binaryStream, bool allowVertexOnlyMesh) |
Mesh * | loadFromVTK (const std::string &filename) |
Loads a mesh from a VTK file. | |
Mesh * | loadFromVTK (std::istream &binaryStream) |
Mesh * | loadFromSURF (const std::string &filename) |
Mesh * | loadFromSURF (std::istream &binaryStream) |
Mesh * | loadFromGRID (const std::string &filename) |
Mesh * | loadFromGRID (std::istream &binaryStream) |
Mesh * | loadFrom3MF (const std::string &filename) |
Mesh * | loadFrom3MF (std::istream &binaryStream) |
Mesh * | loadFromOBJ (const std::string &filename, Progress *progressBar=nullptr, bool allowVertexOnlyMesh=false, bool enforceCLocale=true) |
Loads a mesh from an OBJ file If enforceCLocale is true, the global locale is modified to make sure that the obj file is properly parsed. | |
Mesh * | loadFromOBJ (std::istream &in, const std::string &sourceFilename, Progress *progressBar=nullptr, bool allowVertexOnlyMesh=false, bool enforceCLocale=true) |
Loads a mesh from an OBJ generic stream. | |
Mesh * | loadFromPLY (const std::string &filename, Progress *progress=nullptr, bool allowVertexOnlyMesh=false, bool forceNoChecks=false, bool abortOnFaceAddFailure=false, bool enforceCLocale=true) |
Loads a mesh from an PLY file. | |
Mesh * | loadFromPLY (std::istream &in, std::string &texFile, Progress *progress=nullptr, bool allowVertexOnlyMesh=false, bool forceNoChecks=false, bool abortOnFaceAddFailure=false, bool enforceCLocale=true) |
bool | saveToOBJ (const Mesh &mesh, const std::string &filename, Progress *progress=0, bool saveWithTexture=false, bool optimizeStorage=false, bool allowVertexOnlyMesh=false) |
Save as file in OBJ format, returns true if successful. | |
bool | saveToOBJ (const Mesh &mesh, std::ostream &out, Progress *progress=0, bool saveWithTexture=false, bool optimizeStorage=false, bool allowVertexOnlyMesh=false) |
Save into an output stream in OBJ format, returns true if successful. | |
bool | saveToPLY (const Mesh &mesh, const std::string &filename, bool saveWithTexture=false, bool allowVertexOnlyMesh=false) |
Save as file in PLY format, returns true if successful. | |
bool | saveToPLY (const Mesh &mesh, std::ostream &out, const std::string &textureFilename="", bool allowVertexOnlyMesh=false) |
Save into an output stream in PLY format, returns true if successful. | |
bool | saveToSTL (const Mesh &mesh, const std::string &filename) |
Save as file in STL format, returns true if successful. | |
bool | saveToWRL (const Mesh &mesh, const std::string &filename, Progress *progress=0) |
Save as file in VRML format, returns true if successful. | |
bool | saveToOFF (const Mesh &mesh, const std::string &filename, Progress *progress=0) |
Save as file in OFF format, returns true if successful. | |
bool | saveTo3MF (const Mesh &mesh, const std::string &filename) |
Save as file in OFF format, returns true if successful. | |
std::string | getMeshNameFromPath (const std::string &path) |
Mesh * | loadASCIISTLFile (std::istream &binaryStream) |
Mesh * | loadBinarySTLFile (std::istream &binaryStream) |
Mesh * load | ( | const char * | buffer, |
size_t | bufferLength, | ||
const std::string & | sourceFilename = "", | ||
Progress * | progressBar = nullptr, | ||
bool | log = false ) |
Loads a mesh from a memory buffer.
The optional sourceFilename is used to determine the mesh type and used to load additional files (e.g. materials).
Mesh * load | ( | const std::string & | filename, |
Progress * | progressBar = nullptr, | ||
bool | log = false, | ||
bool | allowVertexOnlyMesh = false, | ||
bool | forceNoChecks = false, | ||
bool | abortOnFaceAddFailure = false ) |
Generic method to load a mesh from a file Supports the following file extensions: stl, off, vtk, ply, obj, surf, grid, 3mf.
log | unused, does not do anything |
allowVertexOnlyMesh | Allows meshes without triangle data (off, ply and obj only) |
forceNoChecks | Disables detecting and working around topology problems (ply only) |
abortOnFaceAddFailure | Discards the mesh when topology prevents adding a face (ply only) Note that working around topology problems may result in new vertices being added, while ignoring them will either result in faces being lost or the mesh being discarded, depending on whether abortOnFaceAddFailure is set. |
Mesh * loadFromOBJ | ( | const std::string & | filename, |
Progress * | progressBar = nullptr, | ||
bool | allowVertexOnlyMesh = false, | ||
bool | enforceCLocale = true ) |
Loads a mesh from an OBJ file If enforceCLocale is true, the global locale is modified to make sure that the obj file is properly parsed.
If this is the case, the function should not be used in parallel with other code that relies on the locale, such as any other number parsing code. If enforceCLocale is false, the function assumes that a C-locale is set such that the decimal separator is '.' If this precondition is not fulfilled (for example, if the current locale uses ',' as decimal separator) an empty mesh is returned Modifying the global locale while the function is running is unspecified behavior and may produce an invalid mesh.
Mesh * loadFromOBJ | ( | std::istream & | in, |
const std::string & | sourceFilename, | ||
Progress * | progressBar = nullptr, | ||
bool | allowVertexOnlyMesh = false, | ||
bool | enforceCLocale = true ) |
Loads a mesh from an OBJ generic stream.
The optional sourceFilename is used to load materials files. Not safe to run in parallel. See the function above for a description of the common parameters