Here's an example!<p>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. :-)<p>Here's an IPython notebook with lots of pictures so you can see how the different operations come together: <a href="https://github.com/gcr/sliderule-bracelet/blob/main/version-3.ipynb" rel="nofollow">https://github.com/gcr/sliderule-bracelet/blob/main/version-...</a><p>build123d is quite different stylistically from cadquery, but this should give you the flavor of programming-oriented CAD at least.
Nice model, but also a great notebook. Really like this "literal coding" style for CAD in a notebook. I still sometimes prefer GUI cad for simple stuff, CadQuery is not always that easy to write. But when iterating over something complicated, the notebook style development is really nice. And being to compose a model using functions and iterators instead of the clumsy GUI workflows is a godsend. Also time I tried Opus was more helpful and capable than I would have thought. Not good enough to one-shot yet, but it is very helpful nonetheless
> wouldn't generally be easy to do with Fusion 360<p>Actually...<p><a href="https://www.youtube.com/watch?v=DNiQJyRTs50" rel="nofollow">https://www.youtube.com/watch?v=DNiQJyRTs50</a><p>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.
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.<p>[0]: <a href="https://en.wikipedia.org/wiki/Slide_rule" rel="nofollow">https://en.wikipedia.org/wiki/Slide_rule</a>
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.<p>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.
Big fan overall. Designed a tension sensitive winch with this a few years back.<p>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.<p>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.<p>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.<p>I do have a gripe though:<p>Having to keep all the geometry selection stuff relating to the model in my head is hard. I want gui tools that write code.<p>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.<p>Look at this example model:
<a href="https://cadquery.readthedocs.io/en/latest/examples.html#a-parametric-enclosure" rel="nofollow">https://cadquery.readthedocs.io/en/latest/examples.html#a-pa...</a><p>This bit that selects some points?<p><pre><code> # compute centers for screw holes
topOfLidCenters = (
cutlip
.faces(">Z")
.workplane(centerOption="CenterOfMass")
.rect(POSTWIDTH, POSTLENGTH, forConstruction=True)
.vertices()
)
</code></pre>
Each of those lines should be a gui tool interaction that generates that line of code.
CadQuery 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.<p>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 some configurable thickness etc. Then I used it to explore how to print the helmet in such a way that the outer surface would be too clean to tell it's FDM printed, without needing to do any sanding.<p>Initially I explored having cadquery put a number on the back of each triangle and I'd assemble it like a puzzle, but that didn't work out. Eventually I figured out how to cut it up into parts that would also eliminate the need for painting and outer surfaces would be clean, and because it was in code, changing which part a triangle belonged to was a matter of moving the corresponding index into another list.<p>I probably could've managed it all in blender too, but being much more comfortable with code, it was easier for me to play with normals and manually turning each piece into a solid.<p>I also go for it for functional designs because, again, tweaking code is more comfortable to me than dealing with constraints and sketches and multiple planes in, say, FreeCAD.
CadQuery was an inspiration when I built FluidCAD. I wanted the workflow to be as close to traditional CAD as possible with more interactive UI.<p><a href="https://fluidcad.io" rel="nofollow">https://fluidcad.io</a>
This looks amazing. I'm going to give this a try later.<p>If I have a DXF or something of the outline of something (a PCB in this case) can I import it and build around it somehow?
How's this different from RepliCAD?
Using a coding CLI I was able to create a computed shape would otherwise by incredibly challenging to make (impossible in parametric CAD GUIs at least) LLMs + CadQuery is a powerful combo, this will be more and more common I think. It's just too powerful to ignore.
I have written a lot of openSCAD code, I learned about BOSL(2) and wrote even more, I tried getting into build123d (and failed, as running openSCAD/BOSL2 is way too comfortable to leave it)... the only downside is that AI fails horribly with those libs and frameworks.<p>I think I heard of cadquery before and decided against it, in favor of build123d.
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.<p>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.<p><a href="https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Manual/Primitive_Solids&stable=1" rel="nofollow">https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Man...</a>
OpenSCAD works natively with triangle meshes. sphere() will create a spherical triangle mesh.<p>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.
Theres a better description of the differences here: <a href="https://build123d.readthedocs.io/en/latest/OpenSCAD.html#transitioning-from-openscad" rel="nofollow">https://build123d.readthedocs.io/en/latest/OpenSCAD.html#tra...</a><p>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.
> I'm not sure I understand your comment<p>Try to do the following with OpenSCAD:<p><pre><code> 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
</code></pre>
This is very, very hard to do with OpenSCAD.
While true your argument is weak, for example in pov-ray the shapes are pure exact mathematical concepts. But nobody is saying how great this is for 3d printing or general cad work because it's not. The real key benefit from these programs is the interchange format they can generate, something you can feed to a machine, this prevents it from ending up like pov-ray, a terminal process only fit for generating pictures. Fillets are difficult to do in openscsd because fillets are difficult to do in general. What your argument probably should have been is that if openscad had chosen a geometry kernel where fillets were already solved it could then do fillets. Which is the sort of obvious tautology that helps no one.<p>Now I am off to see if anyone has ever built an export plugin for pov-sdl, either a 3d rasterizer(g-code slicer) for 3d printing, or a boundary layer mesh generator for import into another program. language wise it is probably equivalent to or better than the openscad sdl,<p>One subtle advantage to using python as the sdl is that it gets access to the vast corpus of python modules out there. Most of which are probably useless. but one thing I want to try is to see if I can use sympy to define a more declarative style of constraint.
Oh boy. The major difference is coordinate transformations, global/local/face. OpenScad basically leaves you alone with math you should figure out on your own. Also it's math heavy for all other stuff, for example tangents, smooth connections, intersection coordinates, etc.
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 <a href="https://github.com/gega/csg2stp" rel="nofollow">https://github.com/gega/csg2stp</a>
I've been using Gemini to generate openscad programs for use with my 3d printer. Is cadquery a better option I wonder?<p>Why do you say it is better than openscad?
After reading some of the docs it does look fun.<p>Python, so leverage your Python skills and existing libraries.<p>A nice GUI so you can build, view, tweak, review, iterate.<p>Will be a nice new toy...
It was a lot more interesting to me back when it first launched and it was a FreeCAD workbench.<p>Previous discussions:<p><a href="https://news.ycombinator.com/item?id=24520014">https://news.ycombinator.com/item?id=24520014</a> (6 years, 49 comments)<p><a href="https://news.ycombinator.com/item?id=30232344">https://news.ycombinator.com/item?id=30232344</a> (4 years, 43 comments)<p><a href="https://news.ycombinator.com/item?id=30219940">https://news.ycombinator.com/item?id=30219940</a> (on Hackaday, 4 years, 28 comments)<p><a href="https://news.ycombinator.com/item?id=17038257">https://news.ycombinator.com/item?id=17038257</a> (8 years, 16 comments)<p><a href="https://news.ycombinator.com/item?id=28083578">https://news.ycombinator.com/item?id=28083578</a> (a Show HN from 5 years ago w/ 1 comment)<p>There are a lot of tools in this space, esp. these days when "Vibe Coding" allows folks to knock one out w/ a prompt. Most folks jus use OpenSCAD which with its large user base and weaknesses which are (mostly) not exposed by 3D printing is great, so long as what one wants to model is easily described using mathematics/programming techniques which are familiar to the user.<p>I'd really like to see an interactive opensource project follow OnShape's lead where a scripting language (for OS, FeatureScript) is used as a wrapper around the geometry kernel, then the graphical UI creates the model using that language, and one can always inspect the resultant code. It seems to me that this <i>should</i> be workable given the observation:<p><a href="https://news.ycombinator.com/item?id=31471109">https://news.ycombinator.com/item?id=31471109</a><p>>Parametric CAD, in my view, is a perfect example of "visual programming", <BR>
>you have variables, iteration/patterning reducing repetition, composability <BR>
>of objects/sketches again reducing repetition, modularity of design though a<BR>
>hierarchy of assemblies. The alignment between programming principles and <BR>
>CAD modelling principles, while not immediately obvious, are very much <BR>
>there. An elegantly designed CAD model is just as beautiful (in its construction) <BR>
>as elegantly written code.<p>but these days, I'm mostly using Open(Python)SCAD (which is in the process of getting merged in to the main project).
If you like this, you should definitely check modelrift.com which allows to build awesome cad models thanks to OpenSCAD and smart AI assistant.<p>Community built examples:
<a href="https://modelrift.com/models" rel="nofollow">https://modelrift.com/models</a>
Came across a similar tool replicad. <a href="https://replicad.xyz/" rel="nofollow">https://replicad.xyz/</a><p>Anyone has used it?
As someone who uses JavaScript/TypeScript, I love Replicad. It is super easy to create and share parametric models from their online editor without any accounts.<p>I keep my models on github[0]. Disclaimer, they are pretty niche things I needed around the house.<p>[0] <a href="https://github.com/Stanko/3d-cad-models" rel="nofollow">https://github.com/Stanko/3d-cad-models</a>
I used cadquery to programmatically generate 3D models for an electronics library for a 1000 or so parts that only differ slightly in their measurements. It literally saved me days of manual work.
How does this compare to anchorcad?
Another library I have to integrate and benchmark against OpenSCAD for my AI SaaS[0]. I am really curious how constructive solid geometry compares to sketching and extruding that CadQuery is build on.<p>Anyone curious in the writeup? I have a pretty good harness for evaluating 3d generation performance.<p>[0]: <a href="https://grandpacad.com" rel="nofollow">https://grandpacad.com</a>
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.
PSA - Codex is really good at creating step files for simpl-ish objects with it.
Guess this is a good opportunity to plug the DIY trackball I made using build123d:<p><a href="https://github.com/ginkgo/trackball/" rel="nofollow">https://github.com/ginkgo/trackball/</a>
Neat!<p>I'm working on a CAD kernel in Rust with a frontend either as a Blender plugin or a Blender fork (leaning towards fork at this point) It's not at all ready but I have reached first part status (before going back and rewriting a large chunk of the kernel)
At the time of writing this there are 24 comments, of which 4 promote alternatives. I feel that recently the number of shameless plugs and check-out-my-SaaS's surged drastically<p><a href="https://news.ycombinator.com/item?id=47803846">https://news.ycombinator.com/item?id=47803846</a>
<a href="https://news.ycombinator.com/item?id=47803475">https://news.ycombinator.com/item?id=47803475</a>
<a href="https://news.ycombinator.com/item?id=47802988">https://news.ycombinator.com/item?id=47802988</a>
<a href="https://news.ycombinator.com/item?id=47803416">https://news.ycombinator.com/item?id=47803416</a>
I believe that in general the comments pointing to alternatives and the shameless plugs are useful in these HN threads, even when their connection with the discussed subject is tenuous.<p>Such comments have become more useful recently, as a form of curated search, when standard Internet searching has started to provide an avalanche of garbage links, to Web pages that only summarize or repeat the primary sources, frequently with errors and failing to point to the original sources.<p>Even if inspecting the suggested alternatives may show them as worthless, finding this may still save time over using a search engine and having to filter an order of magnitude more misleading links.<p>Those not interested in such comments can easily skip over them and not visit any suggested links.<p>When I visit Wikipedia pages, the most frequent reason is for their lists of useful links. Similarly, when reading a HN comment thread, I appreciate links to more or less related content.<p>Today I value such sources far more than a few decades ago, when Google could easily and effortlessly find any desired information, while today you must struggle with any search engine, as they will provide you almost any kind of information, except that requested by you.
+1 for what adrian_b answered above.
All the promotion are for free open source projects and none of them is profitable.
I think this is totally fine, people like to know about alternatives and all these tools are for the purpose of learning and making parametric CAD more approachable to users. They have same goal with different implementation.
Is this the OpenClaw effect?
[dead]
[dead]