Johan Jonker
2016-02-13 21:36:09 UTC
Hello,
I tried to generate an array in a function using a for loop, but it does not
work.
What am I doing wrong.
I tried to do something like this:
The ct function generate a two dimensional vector.
function chamber_(r,rb,h,bt,bb,pc) = [
[0,0],
[for (i=[1:8]) ct(r,bt*i/16,0,r)],
[for (i=[1:8]) ct(rb,-bb*i/16,-h-rb,0,1)],
[-h,0],
[for (i=[8:1]) ct(rb,bb*i/16,-h-rb,0,1)],
[for (i=[8:1]) ct(r,bt*i/16,0,r)],
[0,0],
];
--
View this message in context: http://forum.openscad.org/use-of-for-loop-in-function-tp16116.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I tried to generate an array in a function using a for loop, but it does not
work.
What am I doing wrong.
I tried to do something like this:
The ct function generate a two dimensional vector.
function chamber_(r,rb,h,bt,bb,pc) = [
[0,0],
[for (i=[1:8]) ct(r,bt*i/16,0,r)],
[for (i=[1:8]) ct(rb,-bb*i/16,-h-rb,0,1)],
[-h,0],
[for (i=[8:1]) ct(rb,bb*i/16,-h-rb,0,1)],
[for (i=[8:1]) ct(r,bt*i/16,0,r)],
[0,0],
];
--
View this message in context: http://forum.openscad.org/use-of-for-loop-in-function-tp16116.html
Sent from the OpenSCAD mailing list archive at Nabble.com.