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) |
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
| None mrmeshpy.Laplacian.__init__ | ( | self, | |
| Mesh | mesh ) |
| None mrmeshpy.Laplacian.__init__ | ( | self, | |
| MeshTopology | topology, | ||
| VertCoords | points ) |
| None mrmeshpy.Laplacian.addAttractor | ( | self, | |
| Laplacian.Attractor | a ) |
adds one more attractor to the stored list
| 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
| 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
| 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
| VertBitSet mrmeshpy.Laplacian.firstLayerFixedVerts | ( | self | ) |
return fixed vertices from the first layer around free vertices
| 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)
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)
| VertBitSet mrmeshpy.Laplacian.freeVerts | ( | self | ) |
return currently free vertices
| 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
| 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
| None mrmeshpy.Laplacian.multVertexWeight | ( | self, | |
| VertId | v, | ||
| float | factor ) |
multiplies vertex equation's weight on the given factor
| VertCoords mrmeshpy.Laplacian.points | ( | self | ) |
return the vector of coordinates for which Laplacian was constructed
| VertBitSet mrmeshpy.Laplacian.region | ( | self | ) |
return all initially free vertices and the first layer of vertices around them
| None mrmeshpy.Laplacian.removeAllAttractors | ( | self | ) |
forgets all attractors added previously
| MeshTopology mrmeshpy.Laplacian.topology | ( | self | ) |
return the topology for which Laplacian was constructed
| None mrmeshpy.Laplacian.updateSolver | ( | self | ) |
if you manually call this method after initialization and fixing vertices then next apply call will be much faster