bool inVector(int x, Eigen::VectorXi &vec){ for(int i=0; i L, M, A, Aff; igl::cotmatrix(Vs, Fp, L); igl::massmatrix(Vs, Fp, igl::MASSMATRIX_TYPE_DEFAULT, M); Eigen::SparseMatrix I(M.rows(), M.cols()); I.setIdentity(); A = L*I.cwiseQuotient(M)*L; Aff = A.topLeftCorner(free, free); Afc = A.topRightCorner(free, fixed); // Solve the system, giving us the smoothed vertex positions. Eigen::MatrixXd rhs = -Afc * Vs.bottomRows(fixed); solver.compute(Aff); Vs.topRows(free) = solver.solve(rhs); // Compute detail bases Eigen::MatrixXd Displacement = V - Vs; Eigen::MatrixXd N; std::vector> neighbors; igl::per_vertex_normals(Vs, Fp, N); igl::adjacency_list(Fp, neighbors); d.resize(Vs.rows(), 3); Neighbor.resize(Vs.rows()); for(int i=0; i