From d7cd36b42e104511a65f09d11095ea03f31975f3 Mon Sep 17 00:00:00 2001 From: evouga Date: Thu, 25 Oct 2018 16:56:29 -0500 Subject: [PATCH] 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). --- include/igl/cut_to_disk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/igl/cut_to_disk.cpp b/include/igl/cut_to_disk.cpp index e011b3f75..39c3c3789 100644 --- a/include/igl/cut_to_disk.cpp +++ b/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)