Live data from Hacker News

Parametric CAD in Rust

campedersen.com

91–100 of 184 posts

Re: Parametric CAD in Rust

#91
With the ability to change one number and regenerate everything

That's exactly how I use Solidworks (and similar parametric CAD software) all the time. It takes some discipline, but the key is for all your geometry and relations to be driven from sketches and equations. Then you just change a value (sketch dimension or global constant), hit rebuild, and everything regenerates fairly reliably.

Don't get me wrong, this is a great project and I love seeing efforts like this, OpenSCAD, etc. add more options in the landscape of parametric CAD.

But I do find the graphical interface very natural for doing creative design work. In fact, sometimes I wish I could literally step into my design in VR and grab and move vertices around in 3 dimensions (eg. when fine tuning non-planar splines).

Re: Parametric CAD in Rust

#92
I'm about as into formal methods as you can get, with a deep background in Haskell and such. Rust is wonderful and all that, but sometimes I think the optimism is misplaced and doesn't come from a place of full knowledge. Statements like this make me scared:

> The geometry engine is manifold, which guarantees watertight meshes from boolean operations. The Rust bindings give us zero-cost abstractions over the C++ core — the operator overloads compile down to direct manifold calls. No garbage collection pauses. No floating point surprises from a scripting layer.

Floating point is incredibly surprising. People seem to believe that a typed programming language eliminates floating point error. Scripting and interpretability has nothing to do with why floating point is hard. Floating point arithmetic is as deterministic in Python as C++ or Rust. The issue is whether people understand the rules. The type system has nothing to do with this, as floating point errors are almost always value errors, not type errors. The only way to avoid floating point errors using formal methods is an actual theorem prover. Rust is nowhere close to being a theorem prover.

Re: Parametric CAD in Rust

#93
post #42

Is anyone else put off by the AI-sounding text? Two things that give it away for me are the excessive use of punctuation-emphasized sentence fragments ex: > No clicking. No undo. Just recompile. > That's our mascot. Entirely CSG. > No garbage collection pauses. No floating point surprises from a scripting layer. And worst of all, the dreaded "and/but honestly": > But honestly, the main reason is the toolchain. Am I m…

Yeah I hate it. Why should I read something you didn't bother to write?

Re: Parametric CAD in Rust

#94
I really like the idea of openscad, or this, or the many alternatives. But when I say a shape with these and these dimensions, the next shape should attach to it somewhere. And then I want to say: chamfer all outside edges. But in all these programs, it's me redoing the math in my code, computing where the shape goes. As for chamfers, I just give up ...

Re: Parametric CAD in Rust

#95

Earlier quoted context omitted.

> Constraints and parametrizing are the trivial parts of CAD, something you can now implement in a weekend with Claude Code You go ahead and try that.

;) Keywords: Jacobian, Newton-Raphson, Levenberg-Marquardt, Powell dog leg, Schur complements, sparse QR/Cholesky, and so on. The LLM can figure the rest out. Try it yourself! I recommend Rust because the methods are old and most of the algorithms are already implemented by crates, you just have to wire them together. Like I said the hard part is the b-rep: you’re not going to find anything equivalent to Parasolid or…

Yeah but have you tried it? You can throw as many keywords as you want into Claude but it does get things wrong in sometimes subtle ways. I’ve tried it, I know.

Re: Parametric CAD in Rust

#96

Earlier quoted context omitted.

> "highly paramteric like fastners, gears, 3D printed boxes" 1. These parts should probably be on McMaster. If you are not using them straight from there, you better have a _great_ reason as to why not when it comes up in the design review. 2. Solidworks has Smart Fasteners, Inventor has Spur Gear Component Generator, Sketch->Extrude->Shell takes 30 seconds, so not sure why 3D printed boxes would be faster or better…

> you better have a _great_ reason as to why not Because I don't live in America?

Are ISO standard parts not used where you live? McMaster is in the US but the much of the parts and CAD are standard

Re: Parametric CAD in Rust

#97

Earlier quoted context omitted.

The pull request is to delete the project and open SOLIDWORKS or FreeCAD. But don't actually delete it. It looks like a nice alternative to OpenSCAD. But like OpenSCAD it's really a niche thing for designs that are highly parametric like fasteners, gears, 3D printed boxes, etc. Like OpenSCAD using it for normal "irregular" CAD is going to be extremely frustrating. Like editing an SVG in notepad instead of Inkscape. I…

Are you aware of Rhino 3D with grasshopper?

Rhino has no free tier. I’d love to play with it, and it’s where AutoDesk made the right call. It’s why Fusion 360 has such a strong ecosystem for hobbyists / prosumers.

Re: Parametric CAD in Rust

#98
post #37
post #30

Earlier quoted context omitted.

Read a bit before critisizing: > One thing I care about that most CAD tools don't: vcad is designed to be used by AI coding agents.

For that there’s openscad

Breaks down for complex parts with lots of repeated operations, suffers from floating point rounding errors. No constraint solver.

Re: Parametric CAD in Rust

#99
post #94

I really like the idea of openscad, or this, or the many alternatives. But when I say a shape with these and these dimensions, the next shape should attach to it somewhere. And then I want to say: chamfer all outside edges. But in all these programs, it's me redoing the math in my code, computing where the shape goes. As for chamfers, I just give up ...

Build123d can do chamfers. You can also do relative positioning by selecting positions from the first shape. (there's various ways to do that)

Re: Parametric CAD in Rust

#100
post #51

Earlier quoted context omitted.

It's using a constructive solid geometry system. You can add and subtract volumes. Making a hole is subtracting a volume. This has classically been numeric roundoff hell, where points that should coincide and surfaces which should touch don't get handled properly due to numerical error. The geometry engine is Manifold, which guarantees watertight meshes from boolean operations. Ah. That's what's doing the constructiv…

Manifold (which is doing the heavy lifting in this) uses triangles, which are an approximation. This is never going to have the accuracy seen in higher-end CAD circles, which use b-Reps: highly accurate mathematic representation. Manifold is good for visualization, but to use it as an engine for manufacturing .. its limits will be hit.

Ah. That's good to know. I wondered how they did that. I can see doing it with triangles. Smooth curves are far more difficult.

I'm not an expert at this but I've done CNC machining, used Autodesk Inventor, and coded 3D collision detection. CSG engines were considered mathematical nightmares, and I've used them, but never been inside one. The good ones can take a cylinder and a thread profile, project the thread profile along a spiral as a cutting tool, and make a bolt. Then you can chamfer the end of the bolt, and the ends of the thread are correct.

Post reply on HN