From b6e9179e4888bd52b2881275011e071b59fe1df9 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Mon, 11 Apr 2011 01:51:16 +0200 Subject: misc. fixes: Now supports hull() in OpenCSG mode, dump supports hull(), convexity not needed for hull() diff --git a/src/cgaladv.cc b/src/cgaladv.cc index 66cefa9..dd797fd 100644 --- a/src/cgaladv.cc +++ b/src/cgaladv.cc @@ -105,10 +105,6 @@ AbstractNode *CgaladvModule::evaluate(const Context *ctx, const ModuleInstantiat level = c.lookup_variable("level", true); } - if (type == HULL) { - convexity = c.lookup_variable("convexity", true); - } - node->convexity = (int)convexity.num; node->path = path; node->subdiv_type = subdiv_type.text; @@ -222,6 +218,9 @@ CSGTerm *CgaladvNode::render_csg_term(double m[20], QVector *highlight if (type == SUBDIV) return render_csg_term_from_nef(m, highlights, background, "subdiv", this->convexity); + if (type == HULL) + return render_csg_term_from_nef(m, highlights, background, "hull", this->convexity); + return NULL; } @@ -229,7 +228,7 @@ CSGTerm *CgaladvNode::render_csg_term(double m[20], QVector *highlight CSGTerm *CgaladvNode::render_csg_term(double m[20], QVector *highlights, QVector *background) const { - PRINT("WARNING: Found minkowski(), glide() or subdiv() statement but compiled without CGAL support!"); + PRINT("WARNING: Found minkowski(), glide(), subdiv() or hull() statement but compiled without CGAL support!"); return NULL; } @@ -247,6 +246,8 @@ QString CgaladvNode::dump(QString indent) const } if (type == SUBDIV) text.sprintf("subdiv(level = %d, convexity = %d) {\n", this->level, this->convexity); + if (type == HULL) + text.sprintf("hull() {\n"); foreach (AbstractNode *v, this->children) text += v->dump(indent + QString("\t")); text += indent + "}\n"; -- cgit v0.10.1