Interesting. I have played with OpenScad a bit. This looks similar - i guess the difference is the syntax is python - any other major differences
CadQuery is an open-source Python library for building 3D CAD models
51–60 of 70 posts
Re: CadQuery is an open-source Python library for building 3D CAD models
#52I think I heard of cadquery before and decided against it, in favor of build123d.
Re: CadQuery is an open-source Python library for building 3D CAD models
#53Re: CadQuery is an open-source Python library for building 3D CAD models
#54Doing CAD with code seems like obviously the right move to me. The ability to just write new functions in python and do version control with git are super powerful.
The big thing that struck me as innovative with CadQuery is the design intent query part. Selecting model geometry by relation to other geometry is way more resilient to changes ealier in the model's history than the regular "that point right there" you get with just clicking a point.
That the developers acknowledge that seeing the model at various steps in the script is important, and so have the CQ-editor, is also a point in their favour.
I do have a gripe though:
Having to keep all the geometry selection stuff relating to the model in my head is hard. I want gui tools that write code.
Like if I have a complex model, and variables assigned to various parts of the geometry. I want to be able to see that geometry highlighted and labeled, so I know what's easily selectable, and I want to be able to click buttons based on my design intent and get immediate visual feedback, and have each of those button presses added as code as I do them.
Look at this example model: https://cadquery.readthedocs.io/en/latest/examples.html#a-pa...
This bit that selects some points?
# compute centers for screw holes
topOfLidCenters = (
cutlip
.faces(">Z")
.workplane(centerOption="CenterOfMass")
.rect(POSTWIDTH, POSTLENGTH, forConstruction=True)
.vertices()
)
Each of those lines should be a gui tool interaction that generates that line of code.Re: CadQuery is an open-source Python library for building 3D CAD models
#55Big fan overall. Designed a tension sensitive winch with this a few years back. Doing CAD with code seems like obviously the right move to me. The ability to just write new functions in python and do version control with git are super powerful. The big thing that struck me as innovative with CadQuery is the design intent query part. Selecting model geometry by relation to other geometry is way more resilient to chang…
Re: CadQuery is an open-source Python library for building 3D CAD models
#56Earlier quoted context omitted.
OpenSCAD is all triangles and vertices. Fillets are difficult to do. Outputting circles/spheres generally requires you to for-loop over vertices a lot. Libraries like build123d and cadquery use OpenCASCADE, a boundary representation kernel. You think in terms of the enclosed solid and perform operations - boolean add/subtract, fillet/chamfer, stamp text, etc - that return a new solid.
I'm not sure I understand your comment; OpenSCAD has functions like sphere(), cylinder(), etc. Most OpenSCAD models I have seen are built up primarily from solid primitives combined using boolean operations, just as you describe for the other tools. https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Man...
Try to do the following with OpenSCAD:
1. put a sphere and a torus somewhat close to each other
2. find the shortest segment between the two surfaces
3. place an infinite cylinder whose axis is aligned with the segment you just found
4. fillet the cylinder with both the torus and the sphere along its intersection curve with each surface
This is very, very hard to do with OpenSCAD.Re: CadQuery is an open-source Python library for building 3D CAD models
#57Here's an example! I recently used their sister library (build123d, same devs) to build a rotary slide rule bracelet for multiplying three-digit numbers. It was a great experience and wouldn't generally be easy to do with Fusion 360. My bracelet gets quite a lot of comments when I wear it in public. :-) Here's an IPython notebook with lots of pictures so you can see how the different operations come together: https:/…
> wouldn't generally be easy to do with Fusion 360 Actually... https://www.youtube.com/watch?v=DNiQJyRTs50 You would create the numbers and marks in a vector drawing program (Inkscape, Affinity Studio, Illustrator) and import that into Fusion.
Re: CadQuery is an open-source Python library for building 3D CAD models
#58Earlier quoted context omitted.
> wouldn't generally be easy to do with Fusion 360 Actually... https://www.youtube.com/watch?v=DNiQJyRTs50 You would create the numbers and marks in a vector drawing program (Inkscape, Affinity Studio, Illustrator) and import that into Fusion.
Sure but like, that is specifically NOT easier if you need to iterate once initial implementation is complete. At least in my opinion as an industrial designer turned software engineer, which I only mention to assert I’m experienced in both sets of tools.
Re: CadQuery is an open-source Python library for building 3D CAD models
#59CadQuery and build123d have been very handy for prototyping stuff for 3d printing. AI still isn't quite good enough to generate correct scripts, but AI autocomplete at least helps with putting together small snippets. My last project involved making a cosplay helmet. I modeled the shell in blender, it was a low poly design, so I exported it to an OBJ, then put together some Python to load the OBJ, give the triangles…
for shapes that are hard to print with a traditional slicer, LLMs are also surprisingly good at generating gcode with fullcontrolxyz if you're specific
Re: CadQuery is an open-source Python library for building 3D CAD models
#60Earlier quoted context omitted.
Only step import at the moment. I'll add svg next.
My particular immediate use case would be to export the board outline and mounting holes from a kicad project (SVG or DXF, whatever works) and build a chassis for it. Obviously I can do this in freecad but I've been looking for an intuitive cad-as-code system to check into git instead. So this would be awesome!