From cf15ce518535837fa993ce9a6c631e6c5755165a Mon Sep 17 00:00:00 2001 From: clifford Date: Wed, 24 Jun 2009 17:40:19 +0000 Subject: Clifford Wolf: Fixed CSG product normalization git-svn-id: http://svn.clifford.at/openscad/trunk@17 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/csgterm.cc b/csgterm.cc index 359d3b5..826ec44 100644 --- a/csgterm.cc +++ b/csgterm.cc @@ -69,11 +69,13 @@ CSGTerm *CSGTerm::normalize() y->unlink(); } - do { + while (1) { t2 = t1->normalize_tail(); t1->unlink(); + if (t1 == t2) + break; t1 = t2; - } while (t1 != t2); + } return t1; } diff --git a/mainwin.cc b/mainwin.cc index 86c37ed..352c62d 100644 --- a/mainwin.cc +++ b/mainwin.cc @@ -265,12 +265,13 @@ void MainWindow::actionCompile() root_norm_term = root_raw_term->link(); - CSGTerm *n; - do { - n = root_norm_term->normalize(); + while (1) { + CSGTerm *n = root_norm_term->normalize(); root_norm_term->unlink(); + if (root_norm_term == n) + break; root_norm_term = n; - } while (root_norm_term != n); + } if (!root_norm_term) { console->append("Compilation failed!"); -- cgit v0.10.1