summaryrefslogtreecommitdiff
path: root/src/rotateextrude.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-03-27 22:05:00 (GMT)
committerMarius Kintel <marius@kintel.net>2012-03-27 22:05:58 (GMT)
commit327310f190bbd81c7b71b568d5bf72bb900cc9db (patch)
tree9399bb490ecafe9f0c7fd209c680311d829eb631 /src/rotateextrude.cc
parent4394c7a030ce7a08c95bd1af2e8c38ffcf972439 (diff)
Rewrote the Value class to be based on boost::variant - this should reduce memory footprint and improve performance
Diffstat (limited to 'src/rotateextrude.cc')
-rw-r--r--src/rotateextrude.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rotateextrude.cc b/src/rotateextrude.cc
index e279cf1..10a8ef9 100644
--- a/src/rotateextrude.cc
+++ b/src/rotateextrude.cc
@@ -56,9 +56,9 @@ AbstractNode *RotateExtrudeModule::evaluate(const Context *ctx, const ModuleInst
Context c(ctx);
c.args(argnames, argexpr, inst->argnames, inst->argvalues);
- node->fn = c.lookup_variable("$fn").num;
- node->fs = c.lookup_variable("$fs").num;
- node->fa = c.lookup_variable("$fa").num;
+ node->fn = c.lookup_variable("$fn").toDouble();
+ node->fs = c.lookup_variable("$fs").toDouble();
+ node->fa = c.lookup_variable("$fa").toDouble();
Value file = c.lookup_variable("file");
Value layer = c.lookup_variable("layer", true);
@@ -66,15 +66,15 @@ AbstractNode *RotateExtrudeModule::evaluate(const Context *ctx, const ModuleInst
Value origin = c.lookup_variable("origin", true);
Value scale = c.lookup_variable("scale", true);
- if (!file.text.empty()) {
+ if (!file.isUndefined()) {
PRINT("DEPRECATED: Support for reading files in rotate_extrude will be removed in future releases. Use a child import() instead.");
- node->filename = c.getAbsolutePath(file.text);
+ node->filename = c.getAbsolutePath(file.toString());
}
- node->layername = layer.text;
- node->convexity = (int)convexity.num;
- origin.getv2(node->origin_x, node->origin_y);
- node->scale = scale.num;
+ node->layername = layer.isUndefined() ? "" : layer.toString();
+ node->convexity = (int)convexity.toDouble();
+ origin.getVec2(node->origin_x, node->origin_y);
+ node->scale = scale.toDouble();
if (node->convexity <= 0)
node->convexity = 1;
contact: Jan Huwald // Impressum