#include <MRMesh/MRBox.h>
#include <MRMesh/MRExpandShrink.h>
#include <MRMesh/MRLaplacian.h>
#include <MRMesh/MRMesh.h>
#include <MRMesh/MRMeshLoad.h>
#include <MRMesh/MRMeshSave.h>
#include <iostream>
{
if ( !loadRes.has_value() )
{
std::cerr << loadRes.error() << std::endl;
return 1;
}
const auto ancV0 = mesh.topology.getValidVerts().find_first();
const auto ancV1 = mesh.topology.getValidVerts().find_last();
MR::VertBitSet freeVerts;
freeVerts.resize( mesh.topology.getValidVerts().size() );
freeVerts.set( ancV0, true );
freeVerts.set( ancV1, true );
lDeformer.init( freeVerts, MR::EdgeWeights::Cotan, MR::VertexMass::NeiArea );
const auto shiftAmount = mesh.computeBoundingBox().diagonal() * 0.01f;
lDeformer.fixVertex( ancV0, mesh.points[ancV0] + mesh.normal( ancV0 ) * shiftAmount );
lDeformer.fixVertex( ancV1, mesh.points[ancV1] + mesh.normal( ancV1 ) * shiftAmount );
lDeformer.apply();
mesh.invalidateCaches();
{
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 void expand(const MeshTopology &topology, FaceBitSet ®ion, int hops=1)