Hacker News new | ask | show | jobs
by willrshansen 60 days ago
Big 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 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.
2 comments

The OCP CAD Viewer extension for VS Code (works with both CadQuery and build123d) gets partway there - you can click on faces/edges in the 3D view and it shows you the selection info you'd need for your code. It's not full "click to generate code" but it helps a lot with the "keeping geometry in my head" problem. Still a long way from the OnShape FeatureScript model where GUI and code are truly bidirectional though.
I would be curious to hear more about what makes a winch tension sensitive.

Would it limit and hold a maximum force? Slip beyond a certain limit?