summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/linearextrude.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/linearextrude.cc b/src/linearextrude.cc
index 4f5fd14..8b4d069 100644
--- a/src/linearextrude.cc
+++ b/src/linearextrude.cc
@@ -45,6 +45,8 @@ public:
virtual AbstractNode *evaluate(const Context *ctx, const ModuleInstantiation *inst) const;
};
+#include <iostream>
+
AbstractNode *LinearExtrudeModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const
{
LinearExtrudeNode *node = new LinearExtrudeNode(inst);
@@ -54,6 +56,10 @@ AbstractNode *LinearExtrudeModule::evaluate(const Context *ctx, const ModuleInst
std::vector<Expression*> argexpr;
Context c(ctx);
+ for ( int i = 0 ; i < inst->argnames.size() ; i++ ) {
+ std::cout << "n: " << inst->argnames[i] << "\n" ;
+ std::cout << "v: " << inst->argvalues[i] << "\n";
+ }
c.args(argnames, argexpr, inst->argnames, inst->argvalues);
node->fn = c.lookup_variable("$fn").num;
@@ -75,6 +81,12 @@ AbstractNode *LinearExtrudeModule::evaluate(const Context *ctx, const ModuleInst
node->filename = c.getAbsolutePath(file.text);
}
+ // if height not given, and first argument is a number,
+ // then assume it should be the height.
+ if ( c.lookup_variable("height").type == Value::UNDEFINED )
+ if ( inst->argnames[0] == "" )
+ height = inst->argvalues[0];
+
node->layername = layer.text;
node->height = height.num;
node->convexity = (int)convexity.num;
contact: Jan Huwald // Impressum