summaryrefslogtreecommitdiff
path: root/src/csgtermnormalizer.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2012-05-28 16:48:46 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2012-05-28 16:48:46 (GMT)
commitdd2002a81673b3875ce8c4e8a61cb10278c4eb03 (patch)
tree7aaadf1c9b12cd37a7a913d3e76256f6406fa939 /src/csgtermnormalizer.cc
parent4381762f5aa2e6a56258618e585e1510ead88684 (diff)
parent67eb2ebe90447e966dc1e08b91c43d937c521583 (diff)
Tidy up code. Generate proper test png images. Merge branch 'master' into caliston1.
Conflicts: src/PolySetCGALEvaluator.cc
Diffstat (limited to 'src/csgtermnormalizer.cc')
-rw-r--r--src/csgtermnormalizer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc
index 0e7a759..6600758 100644
--- a/src/csgtermnormalizer.cc
+++ b/src/csgtermnormalizer.cc
@@ -44,9 +44,10 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
do {
while (term && normalize_tail(term)) { }
if (!term || term->type == CSGTerm::TYPE_PRIMITIVE) return term;
- term->left = normalizePass(term->left);
+ if (term->left) term->left = normalizePass(term->left);
} while (term->type != CSGTerm::TYPE_UNION &&
- (term->right->type != CSGTerm::TYPE_PRIMITIVE || term->left->type == CSGTerm::TYPE_UNION));
+ ((term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE) ||
+ (term->left && term->left->type == CSGTerm::TYPE_UNION)));
term->right = normalizePass(term->right);
// FIXME: Do we need to take into account any transformation of item here?
contact: Jan Huwald // Impressum