-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeformsf.h
More file actions
54 lines (43 loc) · 1.15 KB
/
deformsf.h
File metadata and controls
54 lines (43 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef DEFORMSF_H
#define DEFORMSF_H
#include "ARAPDeform.h"
/**
* A Implementation of
* Example-Driven Deformations Based on Discrete Shells
* Volume xx (200y), Number z, pp. 1–11
* Stefan Fröhlich, Mario Botsch
* */
class DeformSF
{
typedef std::vector<double> Feature;
public:
DMEngine *eng;
std::vector<DTriMesh*> meshs;
std::vector<Feature> fvs;
// weight for feature
Feature w;
int featureSize;
int vertexSize;
int edgeSize;
int xSize;
DeformSF(DMEngine &eng, std::vector<DTriMesh*> ms);
// set these term to blend energy
double stretchTerm, bendTerm, volumeTerm;
// iterator therhold
double iterEps;
// default value from the paper
void setTerm(
double stretchTerm = 100,
double bendTerm = 1,
double volumeTerm = 1000);
// given const point, solve mesh
void solve(FeatureVector fv, DTriMesh &mesh);
// given feature vector weights, solve mesh
void solve(std::vector<double> weight, DTriMesh &mesh);
// have not been squared
Feature getFeature(DTriMesh &mesh);
Feature getWeight(DTriMesh &mesh);
DMSpMatrixData getJacob(FeatureVector &fv, DTriMesh &mesh);
void static main();
};
#endif // DEFORMSF_H