MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::Laplacian Class Reference

#include <MRLaplacian.h>

Public Types

enum class  RememberShape { RememberShape::Yes , RememberShape::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
 

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: