3 ms·
I really like the idea of openSCAD, in fact I use it exclusively for 3D modeling. My biggest problem with it is the language implementation. Things like:
by derekp7 6y ago
I really like the idea of openSCAD, in fact I use it exclusively for 3D modeling. My biggest problem with it is the language implementation. Things like:
x = 5;
cylinder(d = x, h=10);
x = 20;
Well, this will make a cylinder with a diameter of 20 instead of the expected value of 5. Yes, I'm familiar with various programming models and the idea of immutable variables. But when you have a language that looks and feels like something else familiar, this behavior can throw you for a loop.
- uranium 6y agoThis. When I was using OpenSCAD about 10 years ago, I immediately found it very intuitive and easy to use for simple things. But for anything complex, I ran into this sort of thing constantly. At the time the documentation of the language mentioned such issues, but failed to specify the language completely, leaving lots of ambiguous cases that I just had to try out to see what would happen. The behavior really seemed to be something that just agglomerated as the author had added features, rather than something planned with a design philosophy behind it. I found it hard to work around and plan more complex shapes as a result. I haven't been back to look at the docs in ages; perhaps it's better-specified now. I ended up doing my more complex stuff in an OpenSCAD clone I hacked together on top of https://evanw.github.io/csg.js/ https://evanw.github.io/csg.js/ until I ran into problems with non-manifold surfaces. Simple problems I could repair, but that library's really only intended for visualizations, not generating STLs for printing, so eventually I went beyond what I could fix. So then I wrote an implicit surface renderer [also in JS] using https://github.com/mikolalysenko/surface-nets https://github.com/mikolalysenko/surface-nets, and that was less-precise, and a bit limited [my code, not theirs], but got the job done. A short while later, I found implicitcad.org, and saw what I could have written, had I had just one more epiphany. I've never used it, but I like the philosophy behind it, and that may be what I try when I get back to 3D printing.
- iamwil 6y agoThis is because you're expecting it to be an imperative language. It's not. OpenSCAD really should throw an error on compile if you try to redefine variables, but its intent is a declarative language. Once you think of it as such, most of its design choices start to make sense.
- marcosdumay 6y agoI fully expected it to be an error. It should be an error. In a declarative languages, one should not be able to update variables. In some contexts, rebiding makes sense, but not on OpenSCAD either.