[OpenSCAD] OpenSCAD Digest, Vol 15, Issue 7
leemon at leemon.com
Tue Feb 15 05:19:03 CET 2011
> So my question is
> simple, what features of the domain specific language are inadequate,
> and what features of the general purpose language are desired.
I'm writing several OpenSCAD libraries to post to Thingiverse. I've had to leave out useful features because the language lacks these:
- variables and general loops (I can't take the sum of an array, or find the max element of an array, or find the running sum of an array (sum of elements up to position i, for all i), which are needed for some OpenSCAD libraries I want to write that the user would pass arrays to).
- recursion (I could live without variables if I had recursion, instead)
- determine how many elements are in an array
- determine how many characters are in a string
- get the nth character of a string, and get it's ASCII code
- FOR loops to create vectors (useful for making 2D parameterized curves to extrude)
- file I/O (for writing libraries to render data in 3D).
- an "assign" statement inside functions
- user-defined modules that call other user-defined modules to operate on their children (it complains about recursion, even though this isn't recursion).
- fix the animation bugs
Adding these features wouldn't make the language harder for beginners. Adding variables would actually make it easier for beginners, because they are confused by the current behavior when you assign twice to the same variable.
There's a reason POV-Ray has both variables and a WHILE loop. It's because you sometimes need them, even if all you're doing is defining a 3D shape.
More information about the OpenSCAD