Live data from Hacker News

CadQuery is an open-source Python library for building 3D CAD models

cadquery.github.io

11–20 of 70 posts

Re: CadQuery is an open-source Python library for building 3D CAD models

#11
post #9

Here'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:/…

how does it work? (the multiplication)

Re: CadQuery is an open-source Python library for building 3D CAD models

#12
post #9

Here'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:/…

[deleted]

Re: CadQuery is an open-source Python library for building 3D CAD models

#13
post #10

Interesting. I have played with OpenScad a bit. This looks similar - i guess the difference is the syntax is python - any other major differences

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...

Re: CadQuery is an open-source Python library for building 3D CAD models

#14
post #9

Here'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:/…

how does it work? (the multiplication)

Are you asking how the bracelet multiplies two numbers? It's the same idea used by slide rules -- you take the logarithm of the two numbers, then add the logarithms instead of multiplying -- same result, with somewhat less accuracy depending on available decimal places.

This method was widely used in the pre-computer era to save time in calculations. Tables of logarithms (and slide rules) were a mathematician's best friend.

Re: CadQuery is an open-source Python library for building 3D CAD models

#15
post #9

Here'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:/…

how does it work? (the multiplication)

Becaus ln(A*B) = ln(A)+ln(B), you need 2 sliding elements and you work in logarithmic scale. Look at "slide rule"[0], this is really nice stuff.

[0]: https://en.wikipedia.org/wiki/Slide_rule

Re: CadQuery is an open-source Python library for building 3D CAD models

#16
I create CAD instructional videos based on SolveSpace, and I sometimes try to get people interested in CADQuery as well, but many people interested in CAD will learn SolveSpace or another similar design program, but don't have the programming background for CADQuery. Too bad -- in many ways, for many projects, CADQuery gives better results, especially if a single design needs to be recreated in a range of sizes.

Re: CadQuery is an open-source Python library for building 3D CAD models

#17
post #13
post #10

Earlier 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...

Theres a better description of the differences here: https://build123d.readthedocs.io/en/latest/OpenSCAD.html#tra...

Some of the differences may be in when you are trying to reference a face/edge to build off of, not just about the primitive function being used.

Re: CadQuery is an open-source Python library for building 3D CAD models

#19
post #13
post #10

Earlier 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...

OpenSCAD works natively with triangle meshes. sphere() will create a spherical triangle mesh.

These libraries on the other hand can natively represent a sphere for instance. This means that during CAD-ing you don't need to worry about resolution, that's a consideration for export only.

Re: CadQuery is an open-source Python library for building 3D CAD models

#20

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 can export STEP files, and is overall much nicer to use in my opinion.

Openscad can export to CSG, which can be imported by free cad or converted to STEP https://github.com/gega/csg2stp
Post reply on HN