Live data from Hacker News

CadQuery: A Python parametric CAD scripting framework based on OCCT

github.com

11–20 of 47 posts

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#12
This is really interesting and compelling to me. I tried FreeCAD recently and couldn't get into it, and went back to onshape. I notice that it doesn't appear to have constraints in it, which is usually a significant part of the CAD workflow. What does one do about that?

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#13
post #8
post #6

Another open source alternative in the wake of the Fusion 360 debacle it seems. I will have a look. I'm no CAD expert and I have tried FreeCAD but it seems it's almost there but not yet. My use cases are very simple and this may be enough but nevertheless I think a GUI is the way to go for these kind of applications.

What is the Fusion 360 debacle?

A few days ago they announced changes to the free/hobbyist version - over the past year or so they've crippled some things and overall there's a bit of an off-putting vibe towards hobby users.

I used Fusion360 a ton for 3D printing and overall it was really nice (it has its warts but it's a pretty amazing app); the past few days I've started looking into alternatives unfortunately.

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#14
This almost made me stop working on my own openscad inspired system in lua. It has almost everything that I think is missing from openscad: * A full programming language * Fillet and chamfer support * A better viewer

The thing that I'm planning to add to my lua cad is materials and PBR in the viewer. Also, I'm still thinking if native bom support is a good idea.

But this looks slick, will definitely give it a try. Python models should be shorter than lua. But I like the lua dsl so far.

Also I'm attempting to write my own cad kernel, which is a dubious choice. But will see where that gets me.

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#15

This is really interesting and compelling to me. I tried FreeCAD recently and couldn't get into it, and went back to onshape. I notice that it doesn't appear to have constraints in it, which is usually a significant part of the CAD workflow. What does one do about that?

Doesn't it being Python (any programming language - OpenSCAD/declaracad too) basically give you constraints for free?

I haven't actually played around with it yet, but surely it's just a matter of combining (or computing from) your (python) variables appropriately? And even having the ability to `assert x > 10` or whatever to validate allowable parameter ranges.

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#16
post #9

I don't really have experience with the architecture of CAD applications. What's the relationship between a CAD program and the OpenCascade kernel? Since both this and FreeCAD use OCCT are files compatible between them?

Open CASCADE is the geometry kernel that does all the heavy lifting (all the geometry related operations and mathematics etc). FreeCAD is a primarily a user interface plus Python script bindings around this kernel. CadQuery implements a Python-based scripting DSL around Open CASCADE to let you build models using code.

File formats between these tools do not necessarily have to be compatible. Open CASCADE ships with exporters for a small number of common CAD file formats, STL being the one that is compatible with most other CAD tools. It also has it's own format for exporting just the geometry (.brep files), and the API provides storage facilities for building your own application-specific container formats (OCAF). I think FreeCAD uses OCAF to implement its native file format.

I know FreeCAD can import/export STL using Open CASCADE, so that's one way transfer models from/to other CAD tools, I would not be surprised of CadQuery can also do this (but I haven't used it so I can't say for sure).

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#17
post #16
post #9

I don't really have experience with the architecture of CAD applications. What's the relationship between a CAD program and the OpenCascade kernel? Since both this and FreeCAD use OCCT are files compatible between them?

Open CASCADE is the geometry kernel that does all the heavy lifting (all the geometry related operations and mathematics etc). FreeCAD is a primarily a user interface plus Python script bindings around this kernel. CadQuery implements a Python-based scripting DSL around Open CASCADE to let you build models using code. File formats between these tools do not necessarily have to be compatible. Open CASCADE ships with e…

STL (and .OBJ) are common exchange formats for mesh output. For solids, which FreeCAD and OpenCASCADE mostly deals in, the typical exchange formats would be STEP (and IGES). Solids can have perfect circles, surfaces etc - where as meshes are just a bunch of 3d vertices with straight line between them. But still there is much information not present in a solid exchange format, like how the model was made: Constraints, feature operations, constraints, undo stack etc.

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#18

I've never seen an actual money making project that would require case that was designed by script. It seems odd but maybe I'm in the wrong I dustry.

Here is one: shafts for power transmission equipment, in our case belt conveyors for bulk material handling. Shafts for pulleys come in all shapes and sizes, ideal use case for code generated models and Cadquery.

I'm very excited that such project exists, API is super nice, you can hook it up with a web server and anything else in python ecosystem. Then our sales people who are tech knowledgeable, but are not engineers can do this for customers without going to engineering. This saves time and shortens the sales cycle

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#19

I've never seen an actual money making project that would require case that was designed by script. It seems odd but maybe I'm in the wrong I dustry.

Here is one: shafts for power transmission equipment, in our case belt conveyors for bulk material handling. Shafts for pulleys come in all shapes and sizes, ideal use case for code generated models and Cadquery. I'm very excited that such project exists, API is super nice, you can hook it up with a web server and anything else in python ecosystem. Then our sales people who are tech knowledgeable, but are not enginee…

How can you size shafts without engineers? Who does the calculation and review? Who is liable if it fails and someone gets hurt?

Re: CadQuery: A Python parametric CAD scripting framework based on OCCT

#20

Earlier quoted context omitted.

Here is one: shafts for power transmission equipment, in our case belt conveyors for bulk material handling. Shafts for pulleys come in all shapes and sizes, ideal use case for code generated models and Cadquery. I'm very excited that such project exists, API is super nice, you can hook it up with a web server and anything else in python ecosystem. Then our sales people who are tech knowledgeable, but are not enginee…

How can you size shafts without engineers? Who does the calculation and review? Who is liable if it fails and someone gets hurt?

It comes from the customers. They know what they want.
Post reply on HN