Live data from Hacker News

OpenSCAD: The Programmer's Solid 3D CAD Modeller

openscad.org

151–160 of 191 posts

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#151

If you want to do code-CAD for anything substantial and you haven't yet developed a significant dependency on OpenSCAD, do your brain a favour and spend at least some time with CadQuery, Build123D or (if you prefer JS to Python) Replicad. As impressive as NopSCADlib and BOSL2 are (and OMG they are, when you consider what they have to work with!) , OpenSCAD is a one-way, declarative CSG environment that essentially on…

The main complaint I have with CadQuery et. al. is the API verbs are all coming from the point of view of describing bRep shapes instead of thinking about the design from the standpoint of "how would I make this?". I think there's an opportunity for a code-first CAD API to incorporate GD&T and manufacturability information directly as part of the modeling process. For example, if I'm making a shaft I want to describe…

Isn't that basically coding in G-code?

The problem of course is that that limits one to straight lines and arc moves.

Are there any really good G-code previewers for lathe work?

For that matter, what is the best 3D G-code previewer which will allow one to see the surface of the cut part in 3D? I'm about to break down and buy tkcnc --- is there something better?

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#152

If you want to do code-CAD for anything substantial and you haven't yet developed a significant dependency on OpenSCAD, do your brain a favour and spend at least some time with CadQuery, Build123D or (if you prefer JS to Python) Replicad. As impressive as NopSCADlib and BOSL2 are (and OMG they are, when you consider what they have to work with!) , OpenSCAD is a one-way, declarative CSG environment that essentially on…

Ah these look so much nicer, thanks! OpenSCAD's willful disregard for the entire CAD industry's well established parametric modelling paradigm always annoyed me.

If you would like to point out a library which allows one to use the "CAD industry's well established modeling paradigm" in OpenSCAD, I would be glad to try it out.

If that doesn't exist, why not?

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#153
post #82

Earlier quoted context omitted.

You call out 2d and mention mills and routers, so after reading the page I'm thinking I wouldn't be able to design a piece to be put in a CNC lathe ala the hub in the lower right of https://canev.com/cdn/shop/products/CEV5205_1024x1024@2x.png... , which has multiple holes (sometimes threaded), including threaded setscrew holes tangential to the primary axis.

Not as-of-yet --- it's 3-axis at the moment --- hoping to eventually add support for additional axis/axes. Have you looked at grblgru.com ? Not opensource, but does have CNC lathe support.

It's not a serious problem I have, just saying I like OpenSCAD, I have been able to generate every shape I've ever needed to create, and it would do everything I want if it was possible to generate true curves (because I farm out the manufacturing).

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#154

Earlier quoted context omitted.

13 minutes. And I am very much at the lower end of the CAD skill scale $fn=100; difference(){ union(){ cylinder(d=55,h=60); translate([125,0,0]) cylinder(d=30,h=32); linear_extrude(11) polygon([[0,25],[125,15],[125,-15],[0,-25]]); translate([0,5.5,0]) rotate([90,0,0]) linear_extrude(11) polygon([[0,50],[125,40],[125,0],[0,0]]); } cylinder(d=35,h=70); translate([125,0,0]) cylinder(d=20,h=40); translate([110,8,98]) rot…

This does not match the drawing. In addition it only took 4 minutes to do it correctly in a normal CAD package [1]. OpenSCAD is cool, but it's not at all a replacement for traditional 3D CAD and I wish people would try to sell it on its strengths instead of selling it as a replacement for traditional CAD. [1]: https://youtu.be/aL5KLXNV-FI

OpenSCAD is really neat! It comes at the model representation process in a very different way.

In it's current form, it will never replace CAD as we know it today.

People have a hard enough time breaking an object they can see into features they can draw and combine, or modify as is done today. Add in the need to work with 2D drawings, sketches, photos, and it gets a bit harder for them still.

I have been training people to use CAD since the days of serious transition away from drafting boards. Very few of them would be able to author the descriptive text examples up thread.

And to be fair, parametric CAD, with or without history is powerful, but hard enough for plenty of people to really struggle, but that difficulty seems a couple orders below what we are discussing here.

Frankly, a better developed OpenSCAD could become a very powerful tool to be used in tandem with traditional CAD. It could even make use of the mature geometry kernels that way too. Those make more complex object and feature create actually work well because they have solutions for the almost innumerable corner and edge cases which always come up.

It is possible to create things largely OpenSCAD style in some CAD programs too. NX has a variety of programming interfaces, one being essentially Visual Basic with CAD appropriate functions.[2] (NX SNAP, as I recall)

You get entity create, query, rename, transform (full transform, scale, translate, rotate), modify like adding a fillet to an edge, boolean cut, join, intersect, split, add, partition... and a whole lot more! (It may not support partition, but it is supposed to for SDRC compatability, and that isn't the point anyway, so... yeah)

And there is the general purpose programming environment. Useful in all the obvious ways we here know well.

The main point is one can take an entirely analytical approach to model create, while also having the robust 3D and on NX 3D stereo[1] even, GUI to evaluate, debug, and all the other good CAD stuff!

To me, that is the OpenSCAD strength. The team can take a peek at the tools I just mentioned, add features and Open Cascade will do way more geometry cases than people think, and now you have model and entity create that can really work for some tough use cases:

--catalog parts with conditional features

--simulation and or analytically driven model shapes, many of which could be used as base features to be finished into manufacturable things

--coupled with an LLM trained on geometry, could result in Star Trek like plain language model create

There is more.

But the actual engineering, product design and manufacturing use cases are not going this way at all. It is too obtuse. People need to see, and I would argue benefit from haptics for interrogation, assembly and more.

Don't get me wrong here. All the open CAD tools are awesome. Open CAD is important and we just don't have much yet, and more is better. We do not have much yet because CAD is really hard, and the robust, mature geometry kernels out there have gazillions of man dev hours in them. Open Cascade is actually quite impressive to be for how well it really does work Given the tiny fraction of dev hours it has by comparison.

And what this means is CAD inertia is a problem likely an order harder than say the replace C code inertial some feel is worth doing.

Best bang for the dev hour investment us to augment and compliment traditional CAD, IMHO of course!

[1] All you need is a stereo capable GPU and display. I used my laptop with nVidia Quadro series and a fast Samsung 3D plasma TV for huge stereo modeling. Frankly, it was crazy good for evaluating technical surfaces and complex, think airplane internals, assembly was down right fun! Recommended and I am unsure why this is not more widely done.

[2] I used SNAP to convert bitmaps into voxel objects, where each voxel was a cube, and from those, combine them into larger voxel objects that were the basis for tooling models to make the desired shape. The retro pixel look you are picturing was desired and I wish I could show the finished project. Neat!

Have also used it to make plenum and manifolds driven by simulation output or area / flow equations.

Both cases would be torture using the traditional CAD model create UX. OpenSCAD is aligned well here if you ask me.

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#155
post #125

Earlier quoted context omitted.

13 minutes. And I am very much at the lower end of the CAD skill scale $fn=100; difference(){ union(){ cylinder(d=55,h=60); translate([125,0,0]) cylinder(d=30,h=32); linear_extrude(11) polygon([[0,25],[125,15],[125,-15],[0,-25]]); translate([0,5.5,0]) rotate([90,0,0]) linear_extrude(11) polygon([[0,50],[125,40],[125,0],[0,0]]); } cylinder(d=35,h=70); translate([125,0,0]) cylinder(d=20,h=40); translate([110,8,98]) rot…

To be fair this is my attempt in build123d. r1, r2 = 55/2, 30/2 cd = 125 # construct rib profile, start with slope and oversized arc # reposition line to be constrained on arc center height and Y axis l = build_line(O, op_line(-8, 30, name='l1'), op_arc(30, -90, name='a1')) l.move(Vector(77-r1*2, 0) - l.a1.center_point) ip, = intersections(l.l1, Axis.Y) l.move(Y(50 - ip.Y)) # Now we know first arc center and could pr…

This was my impression with build123d and Cadquery.

On paper they have a better abstraction than OpenScad. Yet, the code to express the same output is more bloated.

I was never able to get over the yak shaving learning curve to be proficient. Openscad mental model is a lot simpler to sustain momentum to go build something.

How did you get around to prefer Cadquery/build123d?

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#156

Earlier quoted context omitted.

This is good -- but they aren't quite the same? [0] And the way they are not the same is (as the GP is saying) rather telling about the challenge of getting really precise things working in OpenSCAD without a pretty solid grasp of maths. [0] they might be functionally equivalent in application, which is not nothing, of course

Working on this in OpenSCAD (well, BlockSCAD) now: https://www.blockscad3d.com/community/projects/1814083 Trying to work out the triangles/chords to get the radiuses positioned --- a workable approach should be to: - use a triangle to determine the position of the 8 degree rotation and position elements which define the top of the web offset by that distance - use a chord/triangle to determine the position of the cir…

Couldn't let it go, but got everything except for the positioning of the small radius and maybe the height of the web slope is off (had to increase 2 to 2.05 to keep a gap from appearing).

I think if one laid out the radius stuff flat and then rotated it things would be easier to visualize.

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#157

Earlier quoted context omitted.

The main complaint I have with CadQuery et. al. is the API verbs are all coming from the point of view of describing bRep shapes instead of thinking about the design from the standpoint of "how would I make this?". I think there's an opportunity for a code-first CAD API to incorporate GD&T and manufacturability information directly as part of the modeling process. For example, if I'm making a shaft I want to describe…

Isn't that basically coding in G-code? The problem of course is that that limits one to straight lines and arc moves. Are there any really good G-code previewers for lathe work? For that matter, what is the best 3D G-code previewer which will allow one to see the surface of the cut part in 3D? I'm about to break down and buy tkcnc --- is there something better?

> Isn't that basically coding in G-code?

No, I think G-code is too prescriptive and low level for the modelling task. What I'd prefer is some way to specify operations in a fluent, object-oriented API e.g.:

  round_bar = RoundBar(
    alloy=1018, 
    diameter=Dimension(1*Inch, error=0.010*Inch), 
    length=Dimension(12*Inches, error=0.25*Inch)
  )
  3_jaw = 3JawChuck(tolerance=0.005)
  between_centers = BetweenCenters()
  center_drill = CenterDrill(size=4)
  
  shaft = round_bar
    .chuck(configuration=3_jaw)
    .drill(bit=center_drill, depth=Dimension(0.250*Inch, error=0.02*Inch))
    .unchuck()
    .rotate(axis=Y, degrees=180)
    .chuck(configuration=3_jaw)
    .drill(bit=center_drill, depth=Dimension(0.250*Inch, error=0.02*Inch))
    .unchuck()
    .chuck(configuration=between_centers)
    .face()
    .turn(
      target_diameter=Dimension(0.750*Inch, error=0.001*Inch),
      length=Dimension(11.5*Inch, error=0.05*Inch, anchor=round_bar.tailstock_face()),
      finish=Rough
    )
    .external_threads(
      class=ThreeA,
      nominal_size=FiveEighths_18,
      length=Dimension(1.25*Inch, error=0.020*Inch, anchor=round_bar.tailstock_face()),
      reverse=False,
      relief=DefaultRelief(FiveEighths_18)
    )
    ...

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#158

Earlier quoted context omitted.

Sure, but I believe the majority of OpenSCAD users are fine with non-commercial use.

There's a difference between noncommercial and barely commercial; if you model something on OpenSCAD and sell a single copy for $5, is that commercial? Lawyers say yes. But no amount of productivity from Solidworks will make spending $3000/year be worthwhile here.

Solidworks says noncommercial but then gives you $2000 leeway on commercial use before you need a commercial license. I’m not sure how they square that with later saying the watermarked files you’ve created don’t work in a commercial version.

And it leaves you with an awkward gap where you sell $2000 and need a commercial license, but even ignoring income tax you don’t have enough revenue to afford that license.

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#159

If you want to do code-CAD for anything substantial and you haven't yet developed a significant dependency on OpenSCAD, do your brain a favour and spend at least some time with CadQuery, Build123D or (if you prefer JS to Python) Replicad. As impressive as NopSCADlib and BOSL2 are (and OMG they are, when you consider what they have to work with!) , OpenSCAD is a one-way, declarative CSG environment that essentially on…

[deleted]

Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller

#160

Earlier quoted context omitted.

Isn't that basically coding in G-code? The problem of course is that that limits one to straight lines and arc moves. Are there any really good G-code previewers for lathe work? For that matter, what is the best 3D G-code previewer which will allow one to see the surface of the cut part in 3D? I'm about to break down and buy tkcnc --- is there something better?

> Isn't that basically coding in G-code? No, I think G-code is too prescriptive and low level for the modelling task. What I'd prefer is some way to specify operations in a fluent, object-oriented API e.g.: round_bar = RoundBar( alloy=1018, diameter=Dimension(1*Inch, error=0.010*Inch), length=Dimension(12*Inches, error=0.25*Inch) ) 3_jaw = 3JawChuck(tolerance=0.005) between_centers = BetweenCenters() center_drill = C…

I can see where you are coming from, and I've thought about similar ideas. But ultimately, I think this fails for separation-of-concern reasons. Describing the part is different from describing how to make the part. The same part might be sent to 3D printing for a non-functional fit prototype, sent to a prototyping machine shop to make 5 or so units on basic CNC machines that require 3 set-ups to complete it, and after a few design iterations scaled to production on a multi-spindle Swiss-style lathe that drops finished parts into the basket all night long, lights-out. Those are wildly different programs and work flows.

Something like you propose might be an interesting thing to explore for creating CAM posts. The actual Gcode that your API would emit is going to vary quite a lot even within super-similar machines -- a 3+1 axis job targeting a machine with a FANUC controller is going to be pretty different from the same job targeting a machine with a Heidenhain controller.

Post reply on HN