MeshLib Python Docs
Loading...
Searching...
No Matches
meshlib.mrmeshpy.Laplacian Class Reference

Classes

class  EdgeWeights
 
class  RememberShape
 

Public Member Functions

None __init__ (self, Mesh mesh)
 
None apply (self)
 
None applyToScalar (self, VertScalars scalarField)
 
VertBitSet firstLayerFixedVerts (self)
 
None fixVertex (self, VertId v, bool smooth=True)
 
None fixVertex (self, VertId v, Vector3f fixedPos, bool smooth=True)
 
VertBitSet freeVerts (self)
 
None init (self, VertBitSet freeVerts, EdgeWeights weights, Laplacian.RememberShape rem='Laplacian::RememberShape::Yes')
 
VertBitSet region (self)
 
None updateSolver (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.

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ apply()

None meshlib.mrmeshpy.Laplacian.apply ( self)
given fixed vertices, computes positions of remaining region vertices

◆ applyToScalar()

None meshlib.mrmeshpy.Laplacian.applyToScalar ( self,
VertScalars scalarField )
given a pre-resized scalar field with set values in fixed vertices, computes the values in free vertices

◆ firstLayerFixedVerts()

VertBitSet meshlib.mrmeshpy.Laplacian.firstLayerFixedVerts ( self)
return fixed vertices from the first layer around free vertices

◆ fixVertex() [1/2]

None meshlib.mrmeshpy.Laplacian.fixVertex ( self,
VertId 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 meshlib.mrmeshpy.Laplacian.fixVertex ( self,
VertId v,
Vector3f 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)

◆ freeVerts()

VertBitSet meshlib.mrmeshpy.Laplacian.freeVerts ( self)
return currently free vertices

◆ init()

None meshlib.mrmeshpy.Laplacian.init ( self,
VertBitSet freeVerts,
EdgeWeights weights,
Laplacian.RememberShape rem = 'Laplacian::RememberShape::Yes' )
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

◆ region()

VertBitSet meshlib.mrmeshpy.Laplacian.region ( self)
return all initially free vertices and the first layer of vertices around them

◆ updateSolver()

None meshlib.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: