#include <MRMesh/MRAddNoise.h>
#include <MRMesh/MRBox.h>
#include <MRMesh/MRMesh.h>
#include <MRMesh/MRMeshLoad.h>
#include <MRMesh/MRMeshSave.h>
#include <MRMesh/MRNormalDenoising.h>
#include <iostream>
{
if ( !loadRes.has_value() )
{
std::cerr << loadRes.error() << std::endl;
return 1;
}
std::ignore =
MR::addNoise( mesh.points, mesh.topology.getValidVerts(), {
.sigma = mesh.computeBoundingBox().diagonal() * 0.0001f,
} );
mesh.invalidateCaches();
{
std::cerr << saveRes.error() << std::endl;
return 1;
}
{
std::cerr << saveRes.error() << std::endl;
return 1;
}
}
MRMESH_API Expected< Mesh > fromAnySupportedFormat(const std::filesystem::path &file, const MeshLoadSettings &settings={})
MRMESH_API Expected< void > toAnySupportedFormat(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
MRMESH_API Expected< void > meshDenoiseViaNormals(Mesh &mesh, const DenoiseViaNormalsSettings &settings={})
MRMESH_API Expected< void > addNoise(VertCoords &points, const VertBitSet &validVerts, NoiseSettings settings)