#include <MRLaplacian.h>
Public Types | |
enum class | RememberShape { Yes , No } |
Public Member Functions | |
MRMESH_API | Laplacian (Mesh &mesh) |
Laplacian (const MeshTopology &topology, VertCoords &points) | |
MRMESH_API void | init (const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=Laplacian::RememberShape::Yes) |
MRMESH_API void | fixVertex (VertId v, bool smooth=true) |
MRMESH_API void | fixVertex (VertId v, const Vector3f &fixedPos, bool smooth=true) |
MRMESH_API void | updateSolver () |
if you manually call this method after initialization and fixing vertices then next apply call will be much faster | |
MRMESH_API void | apply () |
given fixed vertices, computes positions of remaining region vertices | |
MRMESH_API void | applyToScalar (VertScalars &scalarField) |
given a pre-resized scalar field with set values in fixed vertices, computes the values in free vertices | |
const VertBitSet & | region () const |
return all initially free vertices and the first layer of vertices around them | |
const VertBitSet & | freeVerts () const |
return currently free vertices | |
const VertBitSet & | firstLayerFixedVerts () const |
return fixed vertices from the first layer around free vertices | |
Laplacian to smoothly deform a region preserving mesh fine details. How to use:
|
strong |
|
explicit |
|
inline |
MRMESH_API void MR::Laplacian::apply | ( | ) |
given fixed vertices, computes positions of remaining region vertices
MRMESH_API void MR::Laplacian::applyToScalar | ( | VertScalars & | scalarField | ) |
given a pre-resized scalar field with set values in fixed vertices, computes the values in free vertices
|
inlinenodiscard |
return fixed vertices from the first layer around free vertices
MRMESH_API void MR::Laplacian::fixVertex | ( | VertId | v, |
bool | smooth = true ) |
notify Laplacian that given vertex has changed after init and must be fixed during apply;
smooth | whether to make the surface smooth in this vertex (sharp otherwise) |
MRMESH_API void MR::Laplacian::fixVertex | ( | VertId | v, |
const Vector3f & | fixedPos, | ||
bool | smooth = true ) |
sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);
smooth | whether to make the surface smooth in this vertex (sharp otherwise) |
|
inlinenodiscard |
return currently free vertices
MRMESH_API void MR::Laplacian::init | ( | const VertBitSet & | freeVerts, |
EdgeWeights | weights, | ||
VertexMass | vmass = VertexMass::Unit, | ||
RememberShape | rem = Laplacian::RememberShape::Yes ) |
initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;
freeVerts | must not include all vertices of a mesh connected component |
|
inlinenodiscard |
return all initially free vertices and the first layer of vertices around them
MRMESH_API void MR::Laplacian::updateSolver | ( | ) |
if you manually call this method after initialization and fixing vertices then next apply call will be much faster