libigl v2.5.0
Loading...
Searching...
No Matches
arap.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8#ifndef IGL_ARAP_H
9#define IGL_ARAP_H
10#include "igl_inline.h"
11#include "min_quad_with_fixed.h"
12#include "ARAPEnergyType.h"
13#include <Eigen/Core>
14#include <Eigen/Sparse>
15
16namespace igl
17{
21 struct ARAPData
22 {
24 int n;
27 Eigen::VectorXi G;
33 Eigen::MatrixXd f_ext;
35 Eigen::MatrixXd vel;
37 double h;
39 double ym;
43 Eigen::SparseMatrix<double> K;
45 Eigen::SparseMatrix<double> M;
47 Eigen::SparseMatrix<double> CSM;
51 Eigen::VectorXi b;
53 int dim;
55 n(0),
56 G(),
58 with_dynamics(false),
59 f_ext(),
60 h(1),
61 ym(1),
62 max_iter(10),
63 K(),
64 CSM(),
65 solver_data(),
66 b(),
67 dim(-1) // force this to be set by _precomputation
68 {
69 };
70 };
71
85 template <
86 typename DerivedV,
87 typename DerivedF,
88 typename Derivedb>
90 const Eigen::MatrixBase<DerivedV> & V,
91 const Eigen::MatrixBase<DerivedF> & F,
92 const int dim,
93 const Eigen::MatrixBase<Derivedb> & b,
94 ARAPData & data);
110 template <
111 typename Derivedbc,
112 typename DerivedU>
114 const Eigen::MatrixBase<Derivedbc> & bc,
115 ARAPData & data,
116 Eigen::MatrixBase<DerivedU> & U);
117};
118
119#ifndef IGL_STATIC_LIBRARY
120#include "arap.cpp"
121#endif
122
123#endif
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
bool arap_precomputation(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int dim, const Eigen::MatrixBase< Derivedb > &b, ARAPData &data)
Compute necessary information to start using an ARAP deformation using local-global solver as describ...
bool arap_solve(const Eigen::MatrixBase< Derivedbc > &bc, ARAPData &data, Eigen::MatrixBase< DerivedU > &U)
Conduct arap solve.
ARAPEnergyType
Enum for choosing ARAP energy type.
Definition ARAPEnergyType.h:14
@ ARAP_ENERGY_TYPE_DEFAULT
Choose one automatically: spokes and rims for surfaces, elements for planar meshes and tets (not full...
Definition ARAPEnergyType.h:28
Parameters and precomputed values for arap solver.
Definition arap.h:22
ARAPEnergyType energy
type of energy to use
Definition arap.h:29
bool with_dynamics
whether using dynamics (need to call arap_precomputation after changing)
Definition arap.h:31
Eigen::MatrixXd f_ext
#V by dim list of external forces
Definition arap.h:33
double h
dynamics time step
Definition arap.h:37
Eigen::MatrixXd vel
#V by dim list of velocities
Definition arap.h:35
double ym
"Young's modulus" smaller is softer, larger is more rigid/stiff
Definition arap.h:39
ARAPData()
Definition arap.h:54
Eigen::VectorXi G
#V list of group indices (1 to k) for each vertex, such that vertex i is assigned to group G(i)
Definition arap.h:27
int n
#V size of mesh
Definition arap.h:24
int max_iter
maximum inner iterations
Definition arap.h:41
Parameters and precomputed values for min_quad_with_fixed.
Definition min_quad_with_fixed.h:166