Эх сурвалжийг харах

[BUG FIX]: treating tets as quads

Former-commit-id: c063f83dd7641b5f17cc52183c51b0efb023e73c
Alec Jacobson 7 жил өмнө
parent
commit
c54e955404

+ 4 - 3
include/igl/adjacency_matrix.cpp

@@ -23,15 +23,16 @@ IGL_INLINE void igl::adjacency_matrix(
   typedef Triplet<T> IJV;
   vector<IJV > ijv;
   ijv.reserve(F.size()*2);
-  // Loop over faces
+  // Loop over **simplex** (i.e., **not quad**)
   for(int i = 0;i<F.rows();i++)
   {
-    // Loop over this face
+    // Loop over this **simplex**
     for(int j = 0;j<F.cols();j++)
+    for(int k = j+1;k<F.cols();k++)
     {
       // Get indices of edge: s --> d
       Index s = F(i,j);
-      Index d = F(i,(j+1)%F.cols());
+      Index d = F(i,k);
       ijv.push_back(IJV(s,d,1));
       ijv.push_back(IJV(d,s,1));
     }

+ 1 - 0
include/igl/edges.cpp

@@ -7,6 +7,7 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "edges.h"
 #include "adjacency_matrix.h"
+#include <iostream>
 
 template <typename DerivedF, typename DerivedE>
 IGL_INLINE void igl::edges(