MeshLib
 
Loading...
Searching...
No Matches
Mesh modification

Some examples of mesh modification are presented here

#include <MRMesh/MRMesh.h>
#include <MRMesh/MRTorus.h>
int main()
{
// Relax mesh (5 iterations)
MR::relax( mesh, {{5}} );
// Subdivide mesh
props.maxDeviationAfterFlip = 0.5f;
MR::subdivideMesh( mesh, props );
// Rotate mesh
MR::AffineXf3f rotationXf = MR::AffineXf3f::linear( MR::Matrix3f::rotation( MR::Vector3f::plusZ(), MR::PI_F * 0.5f ) );
mesh.transform( rotationXf );
return 0;
}
MRMESH_API bool relax(Mesh &mesh, const MeshRelaxParams &params={}, ProgressCallback cb={})
MRMESH_API int subdivideMesh(Mesh &mesh, const SubdivideSettings &settings={})
MRMESH_API Mesh makeTorus(float primaryRadius=1.0f, float secondaryRadius=0.1f, int primaryResolution=16, int secondaryResolution=16, std::vector< Vector3f > *points=nullptr)
static constexpr AffineXf linear(const M &A) noexcept
Definition MRMesh/MRAffineXf.h:28
Definition MRMesh/MRMesh.h:23
MRMESH_API void transform(const AffineXf3f &xf, const VertBitSet *region=nullptr)
Definition MRMeshSubdivide.h:17
float maxDeviationAfterFlip
Improves local mesh triangulation by doing edge flips if it does not make too big surface deviation.
Definition MRMeshSubdivide.h:23
static constexpr Vector3 plusZ() noexcept
Definition MRMesh/MRVector3.h:35