From 89d09cb1b4af28eea4c8de5fdb5ab1421e0d0ded Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Tue, 6 May 2008 12:05:55 +0000 Subject: [PATCH] Fix a bug in TopoEdgeFlip::UpdateHeap (walking a around a border vertex). --- vcg/complex/local_optimization/tri_edge_flip.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vcg/complex/local_optimization/tri_edge_flip.h b/vcg/complex/local_optimization/tri_edge_flip.h index 7770c217..cbde176b 100644 --- a/vcg/complex/local_optimization/tri_edge_flip.h +++ b/vcg/complex/local_optimization/tri_edge_flip.h @@ -564,6 +564,10 @@ public: do { // go to the first border (if there is one) pos.NextE(); } while(pos != startpos && !pos.IsBorder()); + + // if a border is reached, set startpos here + if(pos.IsBorder()) + startpos = pos; do { VertexPointer v = pos.VFlip(); @@ -580,6 +584,10 @@ public: do { // go to the first border (if there is one) pos.NextE(); } while(pos != startpos && !pos.IsBorder()); + + // if a border is reached, set startpos here + if(pos.IsBorder()) + startpos = pos; do { VertexPointer v = pos.VFlip();