Răsfoiți Sursa

Merge branch 'master' of github.com:libigl/libigl into alecjacobson

Former-commit-id: a834eee6bd8690b5ded4832a064adfbec07afcef
Alec Jacobson 8 ani în urmă
părinte
comite
aabd0c90c4
2 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 7 0
      include/igl/boundary_loop.cpp
  2. 1 1
      include/igl/slim.cpp

+ 7 - 0
include/igl/boundary_loop.cpp

@@ -114,6 +114,13 @@ IGL_INLINE void igl::boundary_loop(
     }
   }
 
+  //Check for meshes without boundary
+  if (idxMax == -1)
+  {
+      L.clear();
+      return;
+  }
+
   L.resize(Lall[idxMax].size());
   for (size_t i = 0; i < Lall[idxMax].size(); ++i)
   {

+ 1 - 1
include/igl/slim.cpp

@@ -361,7 +361,7 @@ void WeightedGlobalLocal::solve_weighted_arap(const Eigen::MatrixXd& V, const Ei
   } else { // seems like CG performs much worse for 2D and way better for 3D
     Eigen::VectorXd guess(uv.rows()*dim);
     for (int i = 0; i < dim; i++) for (int j = 0; j < dim; j++) guess(uv.rows()*i + j) = uv(i,j); // flatten vector
-    ConjugateGradient<SparseMatrix<double>, Eigen::Upper> solver;
+    ConjugateGradient<SparseMatrix<double>, Eigen::Lower|Upper> solver;
     solver.setTolerance(1e-8);
     Uc = solver.compute(L).solveWithGuess(rhs,guess);
   }