MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRMesh/MRLaplacian.h>

Classes

struct  Attractor
 attracts the given point inside some mesh's triangle to the given target with the given weight More...

Public Member Functions

 Laplacian (Mesh &mesh)
 Laplacian (const MeshTopology &topology, VertCoords &points)
 Laplacian (Laplacian &&) noexcept
 ~Laplacian ()
void init (const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
void initFromPoints (const VertCoords &points, const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
 same as init() but uses the given points instead of ones passed to a constructor for weights computation and shape memory
void fixVertex (VertId v, bool smooth=true)
void fixVertex (VertId v, const Vector3f &fixedPos, bool smooth=true)
void multVertexWeight (VertId v, double factor)
 multiplies vertex equation's weight on the given factor
void updateSolver ()
 if you manually call this method after initialization and fixing vertices then next apply call will be much faster
void applyToVector (VertCoords &points)
void apply ()
void applyToScalar (VertScalars &scalarField)
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
const MeshTopologytopology () const
 return the topology for which Laplacian was constructed
VertCoords & points () const
 return the vector of coordinates for which Laplacian was constructed
void addAttractor (const Attractor &a)
 adds one more attractor to the stored list
void removeAllAttractors ()
 forgets all attractors added previously

Detailed Description

Laplacian to smoothly deform a region preserving mesh fine details. How to use:

  1. Initialize Laplacian for the region being deformed, here region properties are remembered.
  2. Change positions of some vertices within the region and call fixVertex for them.
  3. Optionally call updateSolver()
  4. Call apply() to change the remaining vertices within the region Then steps 1-4 or 2-4 can be repeated.

The documentation for this class was generated from the following file: