Browse Source

changed order of neighborhood traversal for singularity calculation

Former-commit-id: c7d81398d24a4c118ec18266f6fd6034bd7bacb5
Olga Diamanti 9 years ago
parent
commit
cd067ff5c8

+ 2 - 2
include/igl/polyvector_field_singularities_from_matchings.cpp

@@ -33,7 +33,7 @@ void igl::polyvector_field_one_ring_matchings(const Eigen::PlainObjectBase<Deriv
   {
     int fi = VF[vi][i];
     for (int  j=0; j<3; ++j)
-      if (F(fi,(j+1)%3)==vi && TT(fi,j) == -1)
+      if (F(fi,j)==vi && TT(fi,j) == -1)
       {
         ind ++;
         fstart = fi;
@@ -59,7 +59,7 @@ void igl::polyvector_field_one_ring_matchings(const Eigen::PlainObjectBase<Deriv
     // look for the vertex
     int j=-1;
     for (unsigned z=0; z<3; ++z)
-      if (F(current_face,z) == vi)
+      if (F(current_face,(z+1)%3) == vi)
       {
         j=z;
         break;

+ 2 - 1
include/igl/polyvector_field_singularities_from_matchings.h

@@ -45,7 +45,8 @@ namespace igl {
   //   mvi              #numOneRingFaces by 1 list of the indices of the sequentially matching vectors
   //                    in the faces of the one ring (first enty is always vector_id, then the vector matching
   //                    vector_id in the next face, then the vector matching that in the third face etc.)
-  //   fi               #numOneRingFaces by 1 list of the sequentially visited faces in the one ring neighborhood
+  //   fi               #numOneRingFaces by 1 list of the sequentially visited faces in the one ring neighborhood.
+  //                    The one-ring is traversed in CLOCKWISE order with respect to the outward normal. (=opposite)
   //
   template <typename DerivedV, typename DerivedF, typename DerivedM, typename VFType, typename DerivedTT>
   void polyvector_field_one_ring_matchings(const Eigen::PlainObjectBase<DerivedV> &V,