summaryrefslogtreecommitdiff
path: root/src/surface.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/surface.cc')
-rw-r--r--src/surface.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/surface.cc b/src/surface.cc
index e927beb..756ad74 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -79,16 +79,17 @@ AbstractNode *SurfaceModule::evaluate(const Context *ctx, const ModuleInstantiat
Context c(ctx);
c.args(argnames, argexpr, inst->argnames, inst->argvalues);
- node->filename = c.getAbsolutePath(c.lookup_variable("file").text);
+ Value fileval = c.lookup_variable("file");
+ node->filename = c.getAbsolutePath(fileval.isUndefined() ? "" : fileval.toString());
Value center = c.lookup_variable("center", true);
- if (center.type == Value::BOOL) {
- node->center = center.b;
+ if (center.type() == Value::BOOL) {
+ node->center = center.toBool();
}
Value convexity = c.lookup_variable("convexity", true);
- if (convexity.type == Value::NUMBER) {
- node->convexity = (int)convexity.num;
+ if (convexity.type() == Value::NUMBER) {
+ node->convexity = (int)convexity.toDouble();
}
return node;
contact: Jan Huwald // Impressum