From efb9fa3d69bb6d3dba5c385e85e9ee86bb8e0b76 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 17 Apr 2016 01:33:15 +0000 Subject: [PATCH] Actually display the "zero-length edge!" polygon error. Before this commit, the initial state allCoplanar=false took precedence over allNonZeroLen=false, since detecting a zero-length edge short-circuits AssembleLoops. --- src/groupmesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/groupmesh.cpp b/src/groupmesh.cpp index 6f01cb1..124e3fd 100644 --- a/src/groupmesh.cpp +++ b/src/groupmesh.cpp @@ -63,12 +63,12 @@ void Group::GenerateLoops(void) { { bool allClosed = false, allCoplanar = false, allNonZeroLen = false; AssembleLoops(&allClosed, &allCoplanar, &allNonZeroLen); - if(!allCoplanar) { + if(!allNonZeroLen) { + polyError.how = POLY_ZERO_LEN_EDGE; + } else if(!allCoplanar) { polyError.how = POLY_NOT_COPLANAR; } else if(!allClosed) { polyError.how = POLY_NOT_CLOSED; - } else if(!allNonZeroLen) { - polyError.how = POLY_ZERO_LEN_EDGE; } else { polyError.how = POLY_GOOD; // The self-intersecting check is kind of slow, so don't run it