MeshLib C++ Docs
Loading...
Searching...
No Matches

Classes

struct  MR::MeshLoad::ObjLoadSettings
struct  MR::MeshLoad::NamedMesh

Functions

Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile (const std::filesystem::path &file, bool combineAllObjects, const ObjLoadSettings &settings={})
 loads meshes from .obj file
Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile (std::istream &in, bool combineAllObjects, const std::filesystem::path &dir, const ObjLoadSettings &settings={})
Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile (const char *data, size_t size, bool combineAllObjects, const std::filesystem::path &dir, const ObjLoadSettings &settings={})
Expected< LoadedObjectsMR::MeshLoad::loadObjectFromObj (const std::filesystem::path &file, const ProgressCallback &cb={})
 reads all objects from .OBJ file

Variables

bool MR::MeshLoad::ObjLoadSettings::customXf = false
 if true then vertices will be returned relative to some transformation to avoid precision loss
bool MR::MeshLoad::ObjLoadSettings::countSkippedFaces = false
 if true, the number of skipped faces (faces than can't be created) will be counted
ProgressCallback MR::MeshLoad::ObjLoadSettings::callback
 callback for set progress and stop process
bool MR::MeshLoad::ObjLoadSettings::telemetrySignal = true
 permit telemetry signal about loading
std::string MR::MeshLoad::NamedMesh::name
Mesh MR::MeshLoad::NamedMesh::mesh
VertUVCoords MR::MeshLoad::NamedMesh::uvCoords
VertColors MR::MeshLoad::NamedMesh::colors
Vector< std::filesystem::path, TextureId > MR::MeshLoad::NamedMesh::textureFiles
Vector< TextureId, FaceId > MR::MeshLoad::NamedMesh::texturePerFace
std::optional< ColorMR::MeshLoad::NamedMesh::diffuseColor
AffineXf3f MR::MeshLoad::NamedMesh::xf
 transform of the loaded mesh, not identity only if ObjLoadSettings.customXf
int MR::MeshLoad::NamedMesh::skippedFaceCount = 0
 counter of skipped faces (faces than can't be created), not zero only if ObjLoadSettings.countSkippedFaces
int MR::MeshLoad::NamedMesh::duplicatedVertexCount = 0
 counter of duplicated vertices (that created for resolve non-manifold geometry)

Detailed Description

Function Documentation

◆ fromSceneObjFile() [1/3]

Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile ( const char * data,
size_t size,
bool combineAllObjects,
const std::filesystem::path & dir,
const ObjLoadSettings & settings = {} )

#include <MRMesh/MRMeshLoadObj.h>

loads meshes from memory array with .obj file contents

Parameters
dirworking directory where materials and textures are located

◆ fromSceneObjFile() [2/3]

Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile ( const std::filesystem::path & file,
bool combineAllObjects,
const ObjLoadSettings & settings = {} )

#include <MRMesh/MRMeshLoadObj.h>

loads meshes from .obj file

◆ fromSceneObjFile() [3/3]

Expected< std::vector< NamedMesh > > MR::MeshLoad::fromSceneObjFile ( std::istream & in,
bool combineAllObjects,
const std::filesystem::path & dir,
const ObjLoadSettings & settings = {} )

#include <MRMesh/MRMeshLoadObj.h>

loads meshes from a stream with .obj file contents important on Windows: in stream must be open in binary mode

Parameters
dirworking directory where materials and textures are located

◆ loadObjectFromObj()

Expected< LoadedObjects > MR::MeshLoad::loadObjectFromObj ( const std::filesystem::path & file,
const ProgressCallback & cb = {} )

#include <MRMesh/MRMeshLoadObj.h>

reads all objects from .OBJ file

Variable Documentation

◆ callback

ProgressCallback MR::MeshLoad::ObjLoadSettings::callback

callback for set progress and stop process

◆ colors

VertColors MR::MeshLoad::NamedMesh::colors

◆ countSkippedFaces

bool MR::MeshLoad::ObjLoadSettings::countSkippedFaces = false

if true, the number of skipped faces (faces than can't be created) will be counted

◆ customXf

bool MR::MeshLoad::ObjLoadSettings::customXf = false

if true then vertices will be returned relative to some transformation to avoid precision loss

◆ diffuseColor

std::optional<Color> MR::MeshLoad::NamedMesh::diffuseColor

◆ duplicatedVertexCount

int MR::MeshLoad::NamedMesh::duplicatedVertexCount = 0

counter of duplicated vertices (that created for resolve non-manifold geometry)

◆ mesh

Mesh MR::MeshLoad::NamedMesh::mesh

◆ name

std::string MR::MeshLoad::NamedMesh::name

◆ skippedFaceCount

int MR::MeshLoad::NamedMesh::skippedFaceCount = 0

counter of skipped faces (faces than can't be created), not zero only if ObjLoadSettings.countSkippedFaces

◆ telemetrySignal

bool MR::MeshLoad::ObjLoadSettings::telemetrySignal = true

permit telemetry signal about loading

◆ textureFiles

Vector<std::filesystem::path, TextureId> MR::MeshLoad::NamedMesh::textureFiles

◆ texturePerFace

Vector<TextureId, FaceId> MR::MeshLoad::NamedMesh::texturePerFace

◆ uvCoords

VertUVCoords MR::MeshLoad::NamedMesh::uvCoords

◆ xf

AffineXf3f MR::MeshLoad::NamedMesh::xf

transform of the loaded mesh, not identity only if ObjLoadSettings.customXf