#include <MRLaplacian.h>
Laplacian to smoothly deform a region preserving mesh fine details. How to use:
- Initialize Laplacian for the region being deformed, here region properties are remembered.
- Change positions of some vertices within the region and call fixVertex for them.
- Optionally call updateSolver()
- Call apply() to change the remaining vertices within the region Then steps 1-4 or 2-4 can be repeated.
lDeformer.fixVertex( v0, newPos0 );
lDeformer.fixVertex( v1, newPos1 );
lDeformer.apply();
◆ RememberShape
◆ Laplacian() [1/2]
◆ Laplacian() [2/2]
MR::Laplacian::Laplacian |
( |
const MeshTopology & | topology, |
|
|
VertCoords & | points ) |
|
inline |
◆ apply()
given fixed vertices, computes positions of remaining region vertices
◆ applyToScalar()
MRMESH_API void MR::Laplacian::applyToScalar |
( |
VertScalars & | scalarField | ) |
|
given a pre-resized scalar field with set values in fixed vertices, computes the values in free vertices
◆ firstLayerFixedVerts()
const VertBitSet & MR::Laplacian::firstLayerFixedVerts |
( |
| ) |
const |
|
inlinenodiscard |
return fixed vertices from the first layer around free vertices
◆ fixVertex() [1/2]
MRMESH_API void MR::Laplacian::fixVertex |
( |
VertId | v, |
|
|
bool | smooth = true ) |
notify Laplacian that given vertex has changed after init and must be fixed during apply;
- Parameters
-
smooth | whether to make the surface smooth in this vertex (sharp otherwise) |
◆ fixVertex() [2/2]
MRMESH_API void MR::Laplacian::fixVertex |
( |
VertId | v, |
|
|
const Vector3f & | fixedPos, |
|
|
bool | smooth = true ) |
sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);
- Parameters
-
smooth | whether to make the surface smooth in this vertex (sharp otherwise) |
◆ freeVerts()
const VertBitSet & MR::Laplacian::freeVerts |
( |
| ) |
const |
|
inlinenodiscard |
return currently free vertices
◆ init()
initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;
- Parameters
-
freeVerts | must not include all vertices of a mesh connected component |
◆ region()
const VertBitSet & MR::Laplacian::region |
( |
| ) |
const |
|
inlinenodiscard |
return all initially free vertices and the first layer of vertices around them
◆ updateSolver()
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: