summaryrefslogtreecommitdiff
path: root/src/linearextrude.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-02-12 04:33:31 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-10 11:45:28 (GMT)
commit130e10778e9d74ceb07dfc813b85d75a52a71e10 (patch)
treef11ad6722ff461864d83906b29bbabe148858693 /src/linearextrude.cc
parentb5079a189aa70cf36e9a4ded6d891df6ae78ac58 (diff)
Initial code to support scaling of linear_extrude(). Part of Issue #273
Diffstat (limited to 'src/linearextrude.cc')
-rw-r--r--src/linearextrude.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/linearextrude.cc b/src/linearextrude.cc
index bc678e6..89e92ba 100644
--- a/src/linearextrude.cc
+++ b/src/linearextrude.cc
@@ -91,7 +91,7 @@ AbstractNode *LinearExtrudeModule::instantiate(const Context *ctx, const ModuleI
node->height = height.toDouble();
node->convexity = (int)convexity.toDouble();
origin.getVec2(node->origin_x, node->origin_y);
- node->scale = scale.toDouble();
+ node->scale = scale.isUndefined() ? 1 : scale.toDouble();
if (center.type() == Value::BOOL)
node->center = center.toBool();
@@ -102,8 +102,8 @@ AbstractNode *LinearExtrudeModule::instantiate(const Context *ctx, const ModuleI
if (node->convexity <= 0)
node->convexity = 1;
- if (node->scale <= 0)
- node->scale = 1;
+ if (node->scale < 0)
+ node->scale = 0;
if (twist.type() == Value::NUMBER) {
node->twist = twist.toDouble();
@@ -166,6 +166,7 @@ std::string LinearExtrudeNode::toString() const
if (this->has_twist) {
stream << ", twist = " << this->twist << ", slices = " << this->slices;
}
+ stream << ", scale = " << this->scale;
stream << ", $fn = " << this->fn << ", $fa = " << this->fa << ", $fs = " << this->fs << ")";
return stream.str();
contact: Jan Huwald // Impressum