Live data from Hacker News

Curated Code CAD (2020)

learn.cadhub.xyz

11–20 of 41 posts

Re: Curated Code CAD (2020)

#11
There is an OpenCascade version compiled down to wasm [1] that we're currently using embedded in our own app. Rendering to WebGL is relatively straight-forward and the system as a whole works well. Gives me a lot of power when designing mechanical systems and running simulations on the resulting models. Perf of the CAD kernel on the web is not great, but 'just good enough'.

Troubleshooting issues is tricky though. If something doesn't work debugging is nearly impossible and the (C++) docs are very challenging.

OpenCascade is very powerful, but the ergonomics of the API aren't great. Writing a simple FP-style immutable wrapper around it has proven very fruitful and we can now describe relatively complicated models with a bare minimum of TypeScript code. Lot's of fun!

[1] https://github.com/gabrielcuvillier/opencascade-emscripten-p...

Re: Curated Code CAD (2020)

#12
post #9
post #7

No mention of solvespace on the site?

Solvespace is traditional gui cad and not code cad? > software that allows you to define 3D CAD models with code

> Solvespace is traditional gui cad and not code cad?

Fair enough, but:

1. IIRC the engine is original (eg not relying on OpenCascade or somesuch) and high quality code.

2. Adding some sort of Python API to it would be fairly simple given the file format: if you open a solvespace model file [1], it's almost already a script (ascii, with clear commands).

[1] https://solvespace.com/examples.pl

Re: Curated Code CAD (2020)

#13

When I last used OpenSCAD, I found it rather lacking. Basic things like 'hollow this object out, leaving a 3mm shell' are nearly impossible. Anything non-trivial takes minutes or hours to compile, making debugging really hard. Are these newer tools better?

You can probably try ImplicitCAD . I have not used yet, but it's on my stack of things to try for the next time OpenSCAD fails me. And it does have a shell operation.

Re: Curated Code CAD (2020)

#14
I honestly do no see the point of code CAD for anything but a couple limited cases. Designing is an inherently visual process and you lose a lot by working with code.

In modern CAD software one already does 'programming' by specifying geometric constraints. For a great example of the power of this approach, see Ivan Sutherland's sketchpad. Specifying geometry using equations as one often does in code CAD is a much more difficult process than specifying geometric constraints. For example, specifying that a hole is some distance from the edge of a part is quite difficult with code CAD.

In addition, there are already multi-user CAD approaches for doing CAD design as part of a team. BYU's multi-user CAD system is a great example of this. I can't find a video, but it claims to be google docs for CAD, allowing users to edit the same CAD model in parallel using extended versions of commercial CAD software.

Honestly, I think the only reason why code CAD is popular at all is that no good open source CAD software exists, so manual use of CAD kernels is filling the void. Although, FreeCAD is continuing to improve so this may change.

BREP is not necessarily futureproof too. At the current time we can manufacture more complicated parts than we can design. With additive manufacturing we can make very, very complicated parts. [0] gives a great example of some. At the current time there are printers which can make centimeter scale parts with micrometer-scale geometry and there's good reason to believe that the same printing process can be scaled up. Describing a 1 meter cube with a micrometer scale lattice structure using triangle based formats takes something like 500 TB.

Additive manufacturing is also capable of printing multiple materials too. In some cases you can even mix material together, to say have a gradient going from soft to hard material. So there is now a need to describe material composition and be able to describe how that material composition changes in 3d space. Things get particularly weird if bring composites into the mix too. There are number of very different approaches to solving these problems. Some proposals include voxels with 3d textures, volumetric-representations, and even some approaches based on functional programming[1].

[0]https://www.researchgate.net/publication/317614395_Nanolatti... [1]https://www.sciencedirect.com/science/article/abs/pii/S00104...

Re: Curated Code CAD (2020)

#15
post #9

Earlier quoted context omitted.

Solvespace is traditional gui cad and not code cad? > software that allows you to define 3D CAD models with code

> Solvespace is traditional gui cad and not code cad? Fair enough, but: 1. IIRC the engine is original (eg not relying on OpenCascade or somesuch) and high quality code. 2. Adding some sort of Python API to it would be fairly simple given the file format: if you open a solvespace model file [1], it's almost already a script (ascii, with clear commands). [1] https://solvespace.com/examples.pl

> Adding some sort of Python API to it would be fairly simple given the file format.

Great, as soon as they add some sort of API or script input, I will notify author of article about this. BTW, ascii based file is not a script, STL file is also ascii.

Re: Curated Code CAD (2020)

#18

When I last used OpenSCAD, I found it rather lacking. Basic things like 'hollow this object out, leaving a 3mm shell' are nearly impossible. Anything non-trivial takes minutes or hours to compile, making debugging really hard. Are these newer tools better?

I can only speak from a 3d printing perspective, and I've only tried OpenSCAD and FreeCAD. As rough as OpenSCAD is, I find myself coming back to it, because CAD-as-code is just so useful (including leaving comments). For bashing out quick, fairly simple models I still like it. The various OpenSCAD DSLs can help, but also not when they get superseded or get in your way. I think the review on the posts blog summarizes…

AFAIK FreeCAD has Python API.

Though dunno about UX using it, probably not as streamlined as OpenSCAD, though maybe more powerful?

https://wiki.freecadweb.org/FreeCAD_API

Re: Curated Code CAD (2020)

#19

(preface: I love the comprehensiveness of this post, lots of stuff I've never heard of!) I use openscad because its fast and easy, but I can feel its limitations. I want to love CadQuery (cq-editor GUI), because I do a lot of Python work, but something is wonky with the renderer (projection? the edge of a box further from the screen is wider than the edge close to it! like they got the matrix inverted or something) a…

CadQuery is one of the best one imo, part of the reasons why it was the second integration we added to Cadhub [1]

[1] https://cadhub.xyz/dev-ide/cadQuery

Re: Curated Code CAD (2020)

#20

When I last used OpenSCAD, I found it rather lacking. Basic things like 'hollow this object out, leaving a 3mm shell' are nearly impossible. Anything non-trivial takes minutes or hours to compile, making debugging really hard. Are these newer tools better?

I can only speak from a 3d printing perspective, and I've only tried OpenSCAD and FreeCAD. As rough as OpenSCAD is, I find myself coming back to it, because CAD-as-code is just so useful (including leaving comments). For bashing out quick, fairly simple models I still like it. The various OpenSCAD DSLs can help, but also not when they get superseded or get in your way. I think the review on the posts blog summarizes…

I kinda think the many of workbenches in FreeCAD might have been a mistake, it's confusing to know where to start.
Post reply on HN