4 ms·
I can appreciate that point of view given your background. However, as a programmer who dabbles in 3d printing / 2.5d CNC routing, I have the exact opposite ex
by emilecantin 6y ago
I can appreciate that point of view given your background.
However, as a programmer who dabbles in 3d printing / 2.5d CNC routing, I have the exact opposite experience. I spend a lot of time in Fusion 360 just battling the software because for some dumb reason it decided to align the top of my part with the bottom of the other when I actually wanted everything in the same plane.
OpenSCAD just makes a lot more sense to my programmer brain, and I'm often much more productive in it.
However, beyond the obvious graphical VS text interface, there's another significant difference between the two: OpenSCAD's base concept is making operations (add / subtract) on solid primitives (prisms, cylinders, spheres) whereas Fusion360 is based on 2d sketches that you extrude. That latter model works very well with a CNC router & plywood.
- ajb 6y agoFunny thing is, also as a programmer, I find openSCAD annoying. I really want object-oriented objects. I want to be able to declare a cube and then refer to its corners. I want to be able to make a cylinder from point A to point B. Instead, everything is contextual and implicit, and there's no other way of doing anything. I'm sure you can get used to it eventually. But I think we could do better in terms of 'cad designed by programmers'
- kevin_thibedeau 6y agoThe same could be said of SQL or any other 4GL.
- derekp7 6y agoI 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.
- s1artibartfast 6y agoAs I understand it, This is how most traditional cad programs work if you work with their command line interface
- ansible 6y agoYes. I've created a few small things in OpenSCAD. To build up a part, I haven't found a better way than just keep adding up the width of the subcomponents to get the origin of the next piece. It is manageable for me, and I find traditional CAD programs difficult, so I'll keep using it. But I want a better way to do all this.
- rspeele 6y agoI strongly recommend taking a look at SolveSpace[1] and doing at least the first tutorial. It takes maybe 30 minutes and gets you knowing enough to be dangerous. SolveSpace is missing a lot of advanced features, but is reliable and quite adequate for many practical parts you might wish to print or CNC. [1] http://solvespace.com/index.pl http://solvespace.com/index.pl
- flubert 6y agoTake a look at CadQuery: https://cadquery.readthedocs.io/en/latest/quickstart.html https://cadquery.readthedocs.io/en/latest/quickstart.html
- ajb 6y agoLooks really interesting, thanks!
- romwell 6y ago>Funny thing is, also as a programmer, I find openSCAD annoying. I really want object-oriented objects Have you tried OpenJSCAD? It's OpenSCAD meets Javascript. Now, to address the things you mentioned: >I want to be able to make a cylinder from point A to point B. You can write a function that does it in OpenSCAD already > I want to be able to declare a cube and then refer to its corners. Referring to vertices of a solid in general seems to be incompatible with OpenSCAD's paradigm of modeling with boolean operations. You don't know where the vertices are until you render. You can already write a helper function which returns you the vertices of a cube. More than that, you would need another tool. It's not about syntax, to my understanding. [1]https://openjscad.org/ https://openjscad.org/
- ajb 6y agoHaven't tried OpenJSCAD - thanks for the reference. > Referring to vertices of a solid in general seems to be incompatible with OpenSCAD's paradigm of modeling with boolean operations. You don't know where the vertices are until you render. Is it? Well I suppose it is in the general case. It would be hard to refer to an edge that has been created as a result of some difference operation. But the corners of a cube are still valid reference points even if they've been chopped off, and aren't part of the final solid.
- romwell 6y agoI guess so, but I find it a mild inconvenience personally. I'd struggle to come up with an example where it would be a deal-breaker. Could you write about how you'd use it? Incidentally, I ended up needing a function that places a cylinder between two points in OpenSCAD yesterday. Here is my implementation - might come in handy! // Transpose of matrix A (swap rows and columns) function transpose(A) = [for (j = [0:len(A[0])-1]) [for(i = [0:len(A)-1]) A[i][j]]]; // Cylinder of radius r from P to Q module cyl_between(P, Q, r){ v = Q - P; // vector from P to Q L = norm(v); // height of the cylnder = dist(P, Q) c = v / L; // unit vector: direction from P to Q is_c_vertical = ( 1 - abs(c * [0, 0, 1]) < 1e-6); //is c parallel to z axis? u = is_c_vertical ? [1, 0, 0] : cross([0, 0, 1], c); // normal to c and Z axis a = u / norm(u); // unit vector normal to c and the Z axis b = cross(c, a); // unit vector normal to a and b // [a, b, c] is an orthonormal basis, i.e. the rotation matrix; P is the translation MT = [a, b, c, P]; // the transformation matrix M = transpose(MT); // OpenSCAD wants vectors in columns, so we need to transpose multmatrix(M) cylinder(h=L, r=r, $fn=24); }