MeshLib
 
Loading...
Searching...
No Matches
Mesh decimation

Example of mesh decimate

#include "MRMesh/MRMesh.h"
int main()
{
// Load mesh
// Setup decimate parameters
settings.maxError = 0.05f;
// Decimate mesh
MR::decimateMesh( mesh, settings );
// Save result
MR::MeshSave::toAnySupportedFormat( mesh, "decimatedMesh.stl" );
}
MRMESH_API DecimateResult decimateMesh(Mesh &mesh, const DecimateSettings &settings={})
Collapse edges in mesh region according to the settings.
MRMESH_API Expected< Mesh > fromAnySupportedFormat(const std::filesystem::path &file, const MeshLoadSettings &settings={})
detects the format from file extension and loads mesh from it
MRMESH_API VoidOrErrStr toAnySupportedFormat(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
detects the format from file extension and save mesh to it
Parameters structure for MR::decimateMesh.
float maxError
Definition MRMesh/MRMeshDecimate.h:39
Definition MRMesh/MRMesh.h:23