Fixes remaining dxfdim() issue from #217

felipesanches-svg
Marius Kintel 2013-04-27 00:53:41 -04:00
parent ba20c0e800
commit 886bc85eec
7 changed files with 5 additions and 9 deletions

View File

@ -54,7 +54,7 @@ Value builtin_dxf_dim(const Context *ctx, const EvalContext *evalctx)
// See issue #217
for (size_t i = 0; i < evalctx->numArgs(); i++) {
if (evalctx->getArgName(i) == "file")
filename = ctx->getAbsolutePath(evalctx->getArgValue(i).toString());
filename = evalctx->getAbsolutePath(evalctx->getArgValue(i).toString());
if (evalctx->getArgName(i) == "layer")
layername = evalctx->getArgValue(i).toString();
if (evalctx->getArgName(i) == "origin")

View File

@ -142,12 +142,6 @@ Value Expression::evaluate(const Context *context) const
}
if (this->type == "F") {
EvalContext c(context, this->call_arguments);
// Value::VectorType argvalues;
// std::transform(this->children.begin(), this->children.end(),
// std::back_inserter(argvalues),
// boost::bind(&Expression::evaluate, _1, context));
// for (size_t i=0; i < this->children.size(); i++)
// argvalues.push_back(this->children[i]->evaluate(context));
return context->evaluate_function(this->call_funcname, &c);
}
abort();

View File

@ -5,6 +5,5 @@ module localfiles_module()
translate([0,350,0]) rotate_extrude(file="localfile.dxf");
translate([250,0,0]) scale([200,200,50]) surface("localfile.dat");
// This is not supported:
// echo(dxf_dim(file="localfile.dxf", name="localfile"));
translate([0,-200,0]) sphere(r=dxf_dim(file="localfile.dxf", name="localfile")/2);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -13,5 +13,8 @@
surface(file = "localfiles_dir/localfile.dat", center = false);
}
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, -200], [0, 0, 1, 0], [0, 0, 0, 1]]) {
sphere($fn = 0, $fa = 12, $fs = 2, r = 100);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB