MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.Laplacian Class Reference
Inheritance diagram for mrmeshpy.Laplacian:

Classes

class  Attractor
class  ConstAttractor

Public Member Functions

None __init__ (self, Mesh mesh)
None __init__ (self, ConstMeshTopology topology, VertCoords points)
None addAttractor (self, Laplacian.ConstAttractor a)
None apply (self)
None applyToScalar (self, VertScalars scalarField)
None applyToVector (self, VertCoords points)
None fixVertex (self, ConstVertId v, bool smooth=True)
None fixVertex (self, ConstVertId v, ConstVector3f fixedPos, bool smooth=True)
None init (self, ConstVertBitSet freeVerts, EdgeWeights weights, VertexMass vmass='MR::VertexMass::Unit', RememberShape rem='MR::RememberShape::Yes')
None initFromPoints (self, ConstVertCoords points, ConstVertBitSet freeVerts, EdgeWeights weights, VertexMass vmass='MR::VertexMass::Unit', RememberShape rem='MR::RememberShape::Yes')
None multVertexWeight (self, ConstVertId v, float factor)
None removeAllAttractors (self)
None updateSolver (self)
Public Member Functions inherited from mrmeshpy.ConstLaplacian
 __init__ (self, *args, **kwargs)
ConstVertBitSet firstLayerFixedVerts (self)
ConstVertBitSet freeVerts (self)
VertCoords points (self)
ConstVertBitSet region (self)
ConstMeshTopology topology (self)

Detailed Description

Generated from:  MR::Laplacian

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.
\\snippet cpp-samples/LaplacianDeformation.cpp 0

Constructor & Destructor Documentation

◆ __init__() [1/2]

None mrmeshpy.Laplacian.__init__ ( self,
Mesh mesh )

◆ __init__() [2/2]

None mrmeshpy.Laplacian.__init__ ( self,
ConstMeshTopology topology,
VertCoords points )

Member Function Documentation

◆ addAttractor()

None mrmeshpy.Laplacian.addAttractor ( self,
Laplacian.ConstAttractor a )
adds one more attractor to the stored list

◆ apply()

None mrmeshpy.Laplacian.apply ( self)
takes fixed vertex positions from the points vector passed to a constructor,
computes and writes free vertex positions in the points vector passed to a constructor as well

◆ applyToScalar()

None mrmeshpy.Laplacian.applyToScalar ( self,
VertScalars scalarField )
takes fixed vertex scalars from the given field,
computes and writes free vertex scalars in the given field as well

◆ applyToVector()

None mrmeshpy.Laplacian.applyToVector ( self,
VertCoords points )
takes fixed vertex positions from the given points vector,
computes and writes free vertex positions in the given points vector as well

◆ fixVertex() [1/2]

None mrmeshpy.Laplacian.fixVertex ( self,
ConstVertId v,
bool smooth = True )
notify Laplacian that given vertex has changed after init and must be fixed during apply;
\\param smooth whether to make the surface smooth in this vertex (sharp otherwise)

◆ fixVertex() [2/2]

None mrmeshpy.Laplacian.fixVertex ( self,
ConstVertId v,
ConstVector3f fixedPos,
bool smooth = True )
sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);
\\param smooth whether to make the surface smooth in this vertex (sharp otherwise)

◆ init()

None mrmeshpy.Laplacian.init ( self,
ConstVertBitSet freeVerts,
EdgeWeights weights,
VertexMass vmass = 'MR::VertexMass::Unit',
RememberShape rem = 'MR::RememberShape::Yes' )
(re)initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;
\\param freeVerts must not include all vertices of a mesh connected component;

◆ initFromPoints()

None mrmeshpy.Laplacian.initFromPoints ( self,
ConstVertCoords points,
ConstVertBitSet freeVerts,
EdgeWeights weights,
VertexMass vmass = 'MR::VertexMass::Unit',
RememberShape rem = 'MR::RememberShape::Yes' )
same as init() but uses the given points instead of ones passed to a constructor for weights computation and shape memory

◆ multVertexWeight()

None mrmeshpy.Laplacian.multVertexWeight ( self,
ConstVertId v,
float factor )
multiplies vertex equation's weight on the given factor

◆ removeAllAttractors()

None mrmeshpy.Laplacian.removeAllAttractors ( self)
forgets all attractors added previously

◆ updateSolver()

None mrmeshpy.Laplacian.updateSolver ( self)
if you manually call this method after initialization and fixing vertices then next apply call will be much faster

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