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.
pull/4/head
whitequark 2016-04-17 01:33:15 +00:00
parent b3df595769
commit efb9fa3d69
1 changed files with 3 additions and 3 deletions

View File

@ -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