From 83b00f0219b7988c9b0b26d12a6981a2ebfa5ce3 Mon Sep 17 00:00:00 2001 From: "T.Alderighi" Date: Thu, 16 Jan 2020 19:00:30 +0100 Subject: [PATCH] hotfix splitmanifoldcomponents --- vcg/complex/algorithms/clean.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vcg/complex/algorithms/clean.h b/vcg/complex/algorithms/clean.h index a2e71b77..333728d2 100644 --- a/vcg/complex/algorithms/clean.h +++ b/vcg/complex/algorithms/clean.h @@ -689,30 +689,31 @@ public: size_t selCnt=0; for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi) - if( !(*fi).IsD() && !(*fi).IsV() ) + if( !(*fi).IsD() && !(*fi).IsV() && !(*fi).IsS()) { UpdateFlags::FaceClearS(m); std::deque visitStack; visitStack.push_back(&*fi); + assert(!(*fi).IsS()); + assert(!(*fi).IsV()); + (*fi).SetS(); + (*fi).SetV(); + while(!visitStack.empty()) { FacePointer fp = visitStack.front(); visitStack.pop_front(); - fp->SetS(); - - assert(!fp->IsV()); - fp->SetV(); - for(int i=0;iVN();++i) { FacePointer ff = fp->FFp(i); - if(face::IsManifold(*fp, i) && !ff->IsS()) + if(face::IsManifold(*fp, i) && !ff->IsS() && !ff->IsV()) { + ff->IsS(); + ff->IsV(); visitStack.push_back(ff); - assert(!ff->IsV()); } } }