I have an OpenSCAD question, but the rocklinux mailing list is garbage. Maybe you can help?
I have a vector variable:
deck = [64, 89, 18];
that I use to make a deck of cards:
cube(deck);
Can I call out just one number form that vector to use somewhere else?
I want to move the cube by the z dimension, 18. Is there something like deck:3 to grab just the third value?
deck[0], deck[1], deck[2]
brilliant! Thanks @Whosa_whatsis
That should be in the User Manual somewhere
Another trick, if you define global variables like this:
_width = 0;
_length = 1;
_height = 2;
You can access them like this:
deck[_width]
deck[_length]
deck[_height]
May not seem that useful in this case, but it helps a lot if you want to replicate object-oriented programming techniques.
Whoa. That is super useful.
It’s particularly useful when your arrays/vectors are generated by a function (think class constructor).