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

Laplacian to smoothly deform a region preserving mesh fine details. How to use: More...

Inheritance diagram for MR.Laplacian:

Public Member Functions

unsafe Laplacian (MR._ByValue_Laplacian _other)
 Generated from constructor MR.Laplacian.Laplacian.
unsafe Laplacian (MR.Mesh mesh)
 Generated from constructor MR.Laplacian.Laplacian.
unsafe Laplacian (MR.Const_MeshTopology topology, MR.VertCoords points)
 Generated from constructor MR.Laplacian.Laplacian.
unsafe void init (MR.Const_VertBitSet freeVerts, MR.EdgeWeights weights, MR.VertexMass? vmass=null, MR.RememberShape? rem=null)
 (re)initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;
unsafe void initFromPoints (MR.Const_VertCoords points, MR.Const_VertBitSet freeVerts, MR.EdgeWeights weights, MR.VertexMass? vmass=null, MR.RememberShape? rem=null)
 same as init() but uses the given points instead of ones passed to a constructor for weights computation and shape memory Generated from method MR.Laplacian.initFromPoints. Parameter vmass defaults to VertexMass.Unit. Parameter rem defaults to RememberShape.Yes.
unsafe void fixVertex (MR.VertId v, bool? smooth=null)
 notify Laplacian that given vertex has changed after init and must be fixed during apply;
unsafe void fixVertex (MR.VertId v, in MR.Vector3f fixedPos, bool? smooth=null)
 sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);
unsafe void multVertexWeight (MR.VertId v, double factor)
 multiplies vertex equation's weight on the given factor Generated from method MR.Laplacian.multVertexWeight.
unsafe void updateSolver ()
 if you manually call this method after initialization and fixing vertices then next apply call will be much faster Generated from method MR.Laplacian.updateSolver.
unsafe void applyToVector (MR.VertCoords points)
 takes fixed vertex positions from the given points vector, computes and writes free vertex positions in the given points vector as well Generated from method MR.Laplacian.applyToVector.
unsafe void apply ()
 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 Generated from method MR.Laplacian.apply.
unsafe void applyToScalar (MR.VertScalars scalarField)
 takes fixed vertex scalars from the given field, computes and writes free vertex scalars in the given field as well Generated from method MR.Laplacian.applyToScalar.
unsafe void addAttractor (MR.Laplacian.Const_Attractor a)
 adds one more attractor to the stored list Generated from method MR.Laplacian.addAttractor.
unsafe void removeAllAttractors ()
 forgets all attractors added previously Generated from method MR.Laplacian.removeAllAttractors.

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.
    Generated from class MR.Laplacian. This is the non-const half of the class.

Constructor & Destructor Documentation

◆ Laplacian() [1/3]

unsafe MR.Laplacian.Laplacian ( MR._ByValue_Laplacian _other)
inline

Generated from constructor MR.Laplacian.Laplacian.

◆ Laplacian() [2/3]

unsafe MR.Laplacian.Laplacian ( MR.Mesh mesh)
inline

Generated from constructor MR.Laplacian.Laplacian.

◆ Laplacian() [3/3]

unsafe MR.Laplacian.Laplacian ( MR.Const_MeshTopology topology,
MR.VertCoords points )
inline

Generated from constructor MR.Laplacian.Laplacian.

Member Function Documentation

◆ addAttractor()

unsafe void MR.Laplacian.addAttractor ( MR.Laplacian.Const_Attractor a)
inline

adds one more attractor to the stored list Generated from method MR.Laplacian.addAttractor.

◆ apply()

unsafe void MR.Laplacian.apply ( )
inline

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 Generated from method MR.Laplacian.apply.

◆ applyToScalar()

unsafe void MR.Laplacian.applyToScalar ( MR.VertScalars scalarField)
inline

takes fixed vertex scalars from the given field, computes and writes free vertex scalars in the given field as well Generated from method MR.Laplacian.applyToScalar.

◆ applyToVector()

unsafe void MR.Laplacian.applyToVector ( MR.VertCoords points)
inline

takes fixed vertex positions from the given points vector, computes and writes free vertex positions in the given points vector as well Generated from method MR.Laplacian.applyToVector.

◆ fixVertex() [1/2]

unsafe void MR.Laplacian.fixVertex ( MR.VertId v,
bool? smooth = null )
inline

notify Laplacian that given vertex has changed after init and must be fixed during apply;

Parameters
smoothwhether to make the surface smooth in this vertex (sharp otherwise) Generated from method MR.Laplacian.fixVertex. Parameter smooth defaults to true.

◆ fixVertex() [2/2]

unsafe void MR.Laplacian.fixVertex ( MR.VertId v,
in MR.Vector3f fixedPos,
bool? smooth = null )
inline

sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);

Parameters
smoothwhether to make the surface smooth in this vertex (sharp otherwise) Generated from method MR.Laplacian.fixVertex. Parameter smooth defaults to true.

◆ init()

unsafe void MR.Laplacian.init ( MR.Const_VertBitSet freeVerts,
MR.EdgeWeights weights,
MR.VertexMass? vmass = null,
MR.RememberShape? rem = null )
inline

(re)initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;

Parameters
freeVertsmust not include all vertices of a mesh connected component;
usePointsis not nullptr, then these points will be used instead of passed to a constructor for weights computation and shape memory Generated from method MR.Laplacian.init. Parameter vmass defaults to VertexMass.Unit. Parameter rem defaults to RememberShape.Yes.

◆ initFromPoints()

unsafe void MR.Laplacian.initFromPoints ( MR.Const_VertCoords points,
MR.Const_VertBitSet freeVerts,
MR.EdgeWeights weights,
MR.VertexMass? vmass = null,
MR.RememberShape? rem = null )
inline

same as init() but uses the given points instead of ones passed to a constructor for weights computation and shape memory Generated from method MR.Laplacian.initFromPoints. Parameter vmass defaults to VertexMass.Unit. Parameter rem defaults to RememberShape.Yes.

◆ multVertexWeight()

unsafe void MR.Laplacian.multVertexWeight ( MR.VertId v,
double factor )
inline

multiplies vertex equation's weight on the given factor Generated from method MR.Laplacian.multVertexWeight.

◆ removeAllAttractors()

unsafe void MR.Laplacian.removeAllAttractors ( )
inline

forgets all attractors added previously Generated from method MR.Laplacian.removeAllAttractors.

◆ updateSolver()

unsafe void MR.Laplacian.updateSolver ( )
inline

if you manually call this method after initialization and fixing vertices then next apply call will be much faster Generated from method MR.Laplacian.updateSolver.


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