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

Classes

class  Attractor

Public Member Functions

None __init__ (self, Mesh mesh)
None __init__ (self, MeshTopology topology, VertCoords points)
None addAttractor (self, Laplacian.Attractor a)
None apply (self)
None applyToScalar (self, VertScalars scalarField)
None applyToVector (self, VertCoords points)
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, VertexMass vmass='VertexMass::Unit', RememberShape rem='RememberShape::Yes')
None initFromPoints (self, VertCoords points, VertBitSet freeVerts, EdgeWeights weights, VertexMass vmass='VertexMass::Unit', RememberShape rem='RememberShape::Yes')
None multVertexWeight (self, VertId v, float factor)
VertCoords points (self)
VertBitSet region (self)
None removeAllAttractors (self)
MeshTopology topology (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.
\\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,
MeshTopology topology,
VertCoords points )

Member Function Documentation

◆ addAttractor()

None mrmeshpy.Laplacian.addAttractor ( self,
Laplacian.Attractor 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

◆ firstLayerFixedVerts()

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

◆ fixVertex() [1/2]

None 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 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 mrmeshpy.Laplacian.freeVerts ( self)
return currently free vertices

◆ init()

None mrmeshpy.Laplacian.init ( self,
VertBitSet freeVerts,
EdgeWeights weights,
VertexMass vmass = 'VertexMass::Unit',
RememberShape rem = '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;
\\param usePoints is not nullptr, then these points will be used instead of passed to a constructor for weights computation and shape memory

◆ initFromPoints()

None mrmeshpy.Laplacian.initFromPoints ( self,
VertCoords points,
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

◆ multVertexWeight()

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

◆ points()

VertCoords mrmeshpy.Laplacian.points ( self)
return the vector of coordinates for which Laplacian was constructed

◆ region()

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

◆ removeAllAttractors()

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

◆ topology()

MeshTopology mrmeshpy.Laplacian.topology ( self)
return the topology for which Laplacian was constructed

◆ 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: