MeshLib JavaScript Docs
Loading...
Searching...
No Matches
Laplacian Class Reference

Public Member Functions

 Laplacian (Mesh mesh)
void init (VertBitSet freeVerts, EdgeWeights weights)
void init (VertBitSet freeVerts, EdgeWeights weights, VertexMass vmass, RememberShape rem)
void fixVertex (number v, boolean smooth)
void apply ()
void fixVertex (number v, Vector3f fixedPos, boolean smooth)

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.

Constructor & Destructor Documentation

◆ Laplacian()

Laplacian::Laplacian ( Mesh mesh)

Member Function Documentation

◆ apply()

void Laplacian::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

◆ fixVertex() [1/2]

void Laplacian::fixVertex ( number v,
boolean smooth )

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)

◆ fixVertex() [2/2]

void Laplacian::fixVertex ( number v,
Vector3f fixedPos,
boolean smooth )

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)

◆ init() [1/2]

void Laplacian::init ( VertBitSet freeVerts,
EdgeWeights weights )

(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

◆ init() [2/2]

void Laplacian::init ( VertBitSet freeVerts,
EdgeWeights weights,
VertexMass vmass,
RememberShape rem )

(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

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