14 comments

  • gcr 7 hours ago
    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://github.com/gcr/sliderule-bracelet/blob/main/version-...

    build123d is quite different stylistically from cadquery, but this should give you the flavor of programming-oriented CAD at least.

    • tda 3 hours ago
      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
    • aaronbrethorst 6 hours ago
      how does it work? (the multiplication)
      • Loic 4 hours ago
        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

      • lutusp 4 hours ago
        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.

  • hgoel 7 hours ago
    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.

    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.

    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.

    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.

    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.

  • maouida 1 hour ago
    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.

    https://fluidcad.io

  • jetter 3 hours ago
    If you like this, you should definitely check modelrift.com which allows to build awesome cad models thanks to OpenSCAD and smart AI assistant.

    Community built examples: https://modelrift.com/models

  • ozmaverick72 8 hours ago
    Interesting. I have played with OpenScad a bit. This looks similar - i guess the difference is the syntax is python - any other major differences
    • gcr 7 hours ago
      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.

      • 7bees 5 hours ago
        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...

        • seltzered_ 4 hours ago
          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.

        • Doxin 4 hours ago
          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.

          • flowerbreeze 2 hours ago
            Do you mean that OpenScad performs boolean/other operations on triangle meshes, but these libraries don't until output? So they might instead use curved surfaces/edges etc as outputs for operations and only convert to triangles for output or export at the very end?
            • Doxin 1 hour ago
              yes, exactly.
    • DrNefario 8 hours ago
      CadQuery can export STEP files, and is overall much nicer to use in my opinion.
      • RobotToaster 4 hours ago
        Openscad can export to CSG, which can be imported by free cad or converted to STEP https://github.com/gega/csg2stp
      • xrd 8 hours ago
        I've been using Gemini to generate openscad programs for use with my 3d printer. Is cadquery a better option I wonder?

        Why do you say it is better than openscad?

        • xrd 8 hours ago
          After reading some of the docs it does look fun.

          Python, so leverage your Python skills and existing libraries.

          A nice GUI so you can build, view, tweak, review, iterate.

          Will be a nice new toy...

  • atoav 1 hour ago
    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.
  • girishso 4 hours ago
    Came across a similar tool replicad. https://replicad.xyz/

    Anyone has used it?

  • ponyous 3 hours ago
    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.

    Anyone curious in the writeup? I have a pretty good harness for evaluating 3d generation performance.

    [0]: https://grandpacad.com

  • lutusp 4 hours ago
    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.
  • ginko 4 hours ago
    Guess this is a good opportunity to plug the DIY trackball I made using build123d:

    https://github.com/ginkgo/trackball/

  • colechristensen 7 hours ago
    Neat!

    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)

  • fxff 1 hour ago
    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

    https://news.ycombinator.com/item?id=47803846 https://news.ycombinator.com/item?id=47803475 https://news.ycombinator.com/item?id=47802988 https://news.ycombinator.com/item?id=47803416

    • adrian_b 33 minutes ago
      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.

      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.

      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.

      Those not interested in such comments can easily skip over them and not visit any suggested links.

      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.

      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.

    • pyb 37 minutes ago
      Is this the OpenClaw effect?
  • jiusanzhou 3 hours ago
    [dead]
  • kevinten10 8 hours ago
    [dead]