MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshC/MRLaplacian.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRFillHoleNicely.h"
4#include "MRMeshFwd.h"
5
7
9{
10 MRLaplacianRememberShapeYes, // true Laplacian mode when initial mesh shape is remembered and copied in apply
11 MRLaplacianRememberShapeNo // ignore initial mesh shape in the region and just position vertices smoothly in the region
13
14// Laplacian to smoothly deform a region preserving mesh fine details.
15// How to use:
16// 1. Initialize Laplacian for the region being deformed, here region properties are remembered.
17// 2. Change positions of some vertices within the region and call fixVertex for them.
18// 3. Optionally call updateSolver()
19// 4. Call apply() to change the remaining vertices within the region
20// Then steps 1-4 or 2-4 can be repeated.
21typedef struct MRLaplacian MRLaplacian;
22
24
26
27// initialize Laplacian for the region being deformed, here region properties are remembered and precomputed;
28// \param freeVerts must not include all vertices of a mesh connected component
30
31// sets position of given vertex after init and it must be fixed during apply (THIS METHOD CHANGES THE MESH);
32// \param smooth whether to make the surface smooth in this vertex (sharp otherwise)
33MRMESHC_API void mrLaplacianFixVertex( MRLaplacian* laplacian, MRVertId v, const MRVector3f* fixedPos, bool smooth );
34
35// given fixed vertices, computes positions of remaining region vertices
37
MREdgeWeights
Definition MRMeshC/MRFillHoleNicely.h:7
MRLaplacianRememberShape
Definition MRMeshC/MRLaplacian.h:9
@ MRLaplacianRememberShapeNo
Definition MRMeshC/MRLaplacian.h:11
@ MRLaplacianRememberShapeYes
Definition MRMeshC/MRLaplacian.h:10
MRMESHC_API void mrLaplacianFixVertex(MRLaplacian *laplacian, MRVertId v, const MRVector3f *fixedPos, bool smooth)
MRMESHC_API void mrLaplacianFree(MRLaplacian *laplacian)
MRMESHC_API void mrLaplacianInit(MRLaplacian *laplacian, const MRVertBitSet *freeVerts, MREdgeWeights weights, MRLaplacianRememberShape rem)
MRMESHC_API MRLaplacian * mrLaplacianNew(MRMesh *mesh)
MRMESHC_API void mrLaplacianApply(MRLaplacian *laplacian)
struct MRLaplacian MRLaplacian
Definition MRMeshC/MRLaplacian.h:21
#define MR_EXTERN_C_BEGIN
Definition MRMeshC/MRMeshFwd.h:26
struct MRVertBitSet MRVertBitSet
Definition MRMeshC/MRMeshFwd.h:38
#define MR_EXTERN_C_END
Definition MRMeshC/MRMeshFwd.h:27
struct MRMesh MRMesh
Definition MRMeshC/MRMeshFwd.h:47
#define MRMESHC_API
Definition MRMeshC/MRMeshFwd.h:19
three-dimensional vector of floats
Definition MRMeshC/MRVector3.h:9
vertex index
Definition MRMeshC/MRId.h:14