فهرست منبع

Update cut_to_disk.cpp

Fixed a bug in my implementation (did not correctly update all data structures when reversing the direction of traversal of a cut when hitting a dead end).
evouga 6 سال پیش
والد
کامیت
d7cd36b42e
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      include/igl/cut_to_disk.cpp

+ 6 - 0
include/igl/cut_to_disk.cpp

@@ -261,6 +261,12 @@ namespace igl {
                 // we've hit a dead end. reverse and try the other direction
                 std::reverse(cycleverts.begin(), cycleverts.end());
                 std::reverse(cycleedges.begin(), cycleedges.end());
+                cycleidx.clear();
+                for (Index i = 0; i < cycleverts.size(); i++)
+                {
+                    cycleidx[cycleverts[i]] = i;
+                }
+                
                 curvert = cycleverts.back();
                 cure = cycleedges.back();
                 while (curvert != -1 && !foundcycle)