From 018de3987450b70ce2673450bb8cc223a0cb90f1 Mon Sep 17 00:00:00 2001 From: Denis Haumont Date: Wed, 22 May 2024 17:57:29 +0200 Subject: [PATCH] assert improvement to allow debugging --- visilib/plucker_polytope_splitter.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/visilib/plucker_polytope_splitter.h b/visilib/plucker_polytope_splitter.h index dccce71..d70ffb5 100644 --- a/visilib/plucker_polytope_splitter.h +++ b/visilib/plucker_polytope_splitter.h @@ -271,19 +271,27 @@ namespace visilib V_ASSERT(Qm != Qn); if (!MathPredicates::isEdgeCollapsed(aPolyhedron->get(Qn), aPolyhedron->get(Qm), tolerance)) { - V_ASSERT(facetsQm.size() != facetsQn.size() || !std::equal(facetsQm.begin(), facetsQm.end(), facetsQn.begin())); - + if (facetsQm.size() != facetsQn.size() || !std::equal(facetsQm.begin(), facetsQm.end(), facetsQn.begin())) + { aLeft->addEdge(Qm, Qn, aPolyhedron); aRight->addEdge(Qm, Qn, aPolyhedron); + } + else + { + V_ASSERT(0); + } } } } } + aLeft->removeCollapsedEdges(aPolyhedron,tolerance); + aRight->removeCollapsedEdges(aPolyhedron,tolerance); V_ASSERT(aLeft->getEdgeCount() > 0); V_ASSERT(aRight->getEdgeCount() > 0); - // aLeft->V_ASSERTIsValid(aPolyhedron, normalization); - // aRight->V_ASSERTIsValid(aPolyhedron, normalization); + //V_ASSERT(aLeft->isValid(aPolyhedron, normalization,tolerance)); + //V_ASSERT(aRight->isValid(aPolyhedron, normalization,tolerance)); + return ON_BOUNDARY; } }