colah/ImplicitCAD — Issue #29: function variable binding is not consistent with openscad
Author: tolomea
Created: 2012-03-03 23:16:45+00:00
State: open

In particular it looks like openscad is binding free variables at module invocation and implicitcad at module definition.

This scad:

function bob(x) = x*y;
y=10;
sphere(bob(1));

produces a sphere of size 10 in openscad and the following error in implicitcad:

Module sphere failed with the following messages:
error in computing value for arugment r: Can't multiply objects of types Number and Undefined.
Nothing to render

This scad:

y=10;
function bob(x) = x*y;
y=1;
sphere(bob(1));

produces a sphere of size 1 in openscad and a sphere of size 10 in implicitcad.

I'm not sure how useful this behavior is, but if we were not going to support it we would need to come up with a good error message that catches both cases.