|
@@ -1,6 +1,7 @@
|
|
|
#include <igl/svd3x3/arap.h>
|
|
|
#include <igl/writeDMAT.h>
|
|
|
#include <igl/partition.h>
|
|
|
+#include <igl/harmonic.h>
|
|
|
#include <igl/cotmatrix.h>
|
|
|
#include <igl/massmatrix.h>
|
|
|
#include <igl/invert_diag.h>
|
|
@@ -155,43 +156,6 @@ int num_in_selection(const Eigen::VectorXi & S)
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
-bool harmonic(
|
|
|
- const Eigen::MatrixXd & V,
|
|
|
- const Eigen::MatrixXi & F,
|
|
|
- const Eigen::VectorXi & b,
|
|
|
- const Eigen::MatrixXd & bc,
|
|
|
- const int k,
|
|
|
- Eigen::MatrixXd & W)
|
|
|
-{
|
|
|
- using namespace igl;
|
|
|
- using namespace Eigen;
|
|
|
- SparseMatrix<double> L,M,Mi;
|
|
|
- cotmatrix(V,F,L);
|
|
|
- massmatrix(V,F,MASSMATRIX_VORONOI,M);
|
|
|
- invert_diag(M,Mi);
|
|
|
- SparseMatrix<double> Q = -L;
|
|
|
- for(int p = 1;p<k;p++)
|
|
|
- {
|
|
|
- Q = (Q*Mi*-L).eval();
|
|
|
- }
|
|
|
- const VectorXd B = VectorXd::Zero(V.rows(),1);
|
|
|
- min_quad_with_fixed_data<double> data;
|
|
|
- min_quad_with_fixed_precompute(Q,b,SparseMatrix<double>(),true,data);
|
|
|
- W.resize(V.rows(),bc.cols());
|
|
|
- for(int w = 0;w<bc.cols();w++)
|
|
|
- {
|
|
|
- const VectorXd bcw = bc.col(w);
|
|
|
- VectorXd Ww;
|
|
|
- if(!min_quad_with_fixed_solve(data,B,bcw,VectorXd(),Ww))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- W.col(w) = Ww;
|
|
|
- }
|
|
|
- return true;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
bool init_arap()
|
|
|
{
|
|
|
using namespace igl;
|