summaryrefslogtreecommitdiff
path: root/src/csgtermnormalizer.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-18 22:49:27 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-18 22:49:27 (GMT)
commite93a23fdb8f478c2ebbda68df3d5c6d1441fc5bd (patch)
treef3ded751b285adc60eb0bb13b2f4df142c47f197 /src/csgtermnormalizer.cc
parent1cfc8c68a2681211f2d5b29e580f36854769d7f9 (diff)
Make CSG normalization limit follow the configured CSG limit
Diffstat (limited to 'src/csgtermnormalizer.cc')
-rw-r--r--src/csgtermnormalizer.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc
index a830422..c4caa8f 100644
--- a/src/csgtermnormalizer.cc
+++ b/src/csgtermnormalizer.cc
@@ -2,7 +2,8 @@
#include "csgterm.h"
#include "printutils.h"
-shared_ptr<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &root)
+shared_ptr<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &root,
+ size_t limit)
{
shared_ptr<CSGTerm> temp = root;
while (1) {
@@ -14,8 +15,8 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &root
#ifdef DEBUG
PRINTF("Normalize count: %d\n", num);
#endif
- if (num > 5000) {
- PRINTF("WARNING: Normalized tree is growing past 5000 elements. Aborting normalization.\n");
+ if (num > limit) {
+ PRINTF("WARNING: Normalized tree is growing past %d elements. Aborting normalization.\n", limit);
return root;
}
}
contact: Jan Huwald // Impressum