Live data from Hacker News

Parametric CAD in Rust

campedersen.com

141–150 of 184 posts

Re: Parametric CAD in Rust

#142

Earlier quoted context omitted.

Note: This is probably a dead-end; it is not on the same level as SolidWorks, Fusion etc.

Or Blender, pen and paper, bag of LEGO, etc. Text in context of geometric object is more or less an abstract classification tool, barely a descriptive one. Everyone knows what a `dice` is. But that's a taxonomical label, not a definition of one. Anyone reading this can probably draw a representative `dice` using only standard stationery supplies in under a minute. Now describe one in English with such rigor and preci…

The great thing about OpenSCAD is that one can model anything which one can describe using mathematics and cubes, cylinders, spheres, and transformations/relocations of same.

The awful thing about OpenSCAD is that what one can model is bounded by one's fluency with mathematics and one's ability to place and transform cubes, cylinders, and spheres.

Re: Parametric CAD in Rust

#143
post #60
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.

AI coding agents are notoriously bad at anything that involves spatial awareness.

Over the weekend I took pictures of the four walls of my office and asked Claude Desktop to examine them and give me a plan for tackling it. It absolutely “understood” my room, identifying the different (messy) workspaces and various piles of stuff on the ground. It generated a checklist with targeted advice and said that I should be motivated to clean up because the “welcome back daddy” sign up on the wall indicates that my kids love me and want a nice space to share with me.

I vibe-code TUI and GUI by making statements like “make the panel on the right side two pixels thinner”.

Related to this thread, I explored agentic looping for 3d models (with a swift library, could be done with this Rust one by following the workflow: https://github.com/ConAcademy/WeaselToonCadova

Re: Parametric CAD in Rust

#144

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…

I can't help but find this comment a little insulting. It's very similar to saying "if, while, else, malloc. The LLM can figure the rest out!" as if CS were a solved thing and the whole challenge weren't assembling those elementary bricks together in computationally efficient and robust ways.

Also more to the point, I doubt you'll have much success with local optimization on general surfaces if you don't have some kind of tessellation or other spacial structure to globalize that a bit, because you can very easily get stuck in local optima even while doing something as trivial as projecting a point onto a surface. Think of anything that "folds", like a U-shape, a point can be very close to one of the branches, but Newton might still find it on the other side if you seeded the optimizer closer to there. It doesn't matter whether you use vanilla Newton or Newton with tricks up to the gills. And anything to do with matrices will only help with local work as well because, well, these are non-linear things.

"Just work in parameter space" is hardly a solution either, considering many mappings encountered in BREPs are outright degenerate in places or stretch the limits floating point stability. And the same issue with local minima will arise, even though the domain is now convex.

So I might even reduce your list to: Taylor expansion, linear solver. You probably don't need much more than that, the difficulty is everything else you're not thinking of.

And remember, this has to be fast, perfectly robust, and commit error under specified tolerance (ideally, something most CAD shops don't even promise).

Re: Parametric CAD in Rust

#145

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…

I'm with you. What I've learned from all those "programmatic CAD" threads is that some people just really prefer code over anything else. They also build only simple parts, so it's not an issue for them. As the author says: "I wanted to write my parts the way I write firmware. In Rust. With types. With version control."

Even as some who would generally prefer graphical CAD software in most cases, sometimes for simple parts like the examples in the linked article code really is just easier.

Sometimes it’s the same when I’m working on texturing for 3D models and I want to combine some texture maps in a specific way, I really don’t want to open Photoshop or similar for something that could be expressed in just a few lines of code. ImageMagick can probably do it, whatever it is, but then I need to learn the incantation.

Re: Parametric CAD in Rust

#146
post #7

Earlier quoted context omitted.

Breps. Nearly all commercial cad packages operate on boundary representations of objects.

Mesh is also a boundary representation. I think you meam NURBS.

It's just the name, BREP stands for Boundary REPresentation.

Re: Parametric CAD in Rust

#147

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…

Sure man. Solidworks will be out of business any day now.

Re: Parametric CAD in Rust

#148

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…

"I do find the graphical interface very natural for doing creative design work"

As do I!

I don't think there is any correct single answer. People, their workflows, and requirements are different.

It seems we are living in CAD renaissance which is great! So many new promising new companies and free tools popping up.

Personally I would prioritize data stability and visual accessibility. These give user a creative workspace that is intuitive and forgiving. That's why I started doing my own modeler as a side project:

https://github.com/AdaShape/adashape-open-testing/releases/t...

The data model is fully immutable and would enable doing _proper_ model branching when I get there. For now all the user gets is a super robust undo and not needing to save (the model is streamed to disk persistently).

But eventually I would like it to be a visual, robust workbench where you can iterate fast, save versions when feel like it, etc.

(I worked for a decade on various CAD offerings at Trimble including SketchUp so know fairly well what I'm doing but it's still super early)

Re: Parametric CAD in Rust

#149

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 you saying that you don't us McMaster because they don't ship to where you live? That seems silly - you can still download their drawings and then find an alternate source. They are a great listing of everything you might ever want to buy, but you can almost always find an alternative source.

There is also the possibility you think because McMaster is in the US they don't have metric parts. This is wrong, a lot of engineering in the US is done in metric - nearly all big manufacturing companies went metric 40 years ago, so they have plenty of metric parts that you should work with. Of course most manufacturing is small companies that still haven't gone metric, but they also deal with metric once in a while, and in any case you wouldn't be ordering from them anyway.

Re: Parametric CAD in Rust

#150

Earlier quoted context omitted.

Note: This is probably a dead-end; it is not on the same level as SolidWorks, Fusion etc.

I wouldn't call a FOSS project that you compare to some 2,620 USD/year software a dead-end. It's good enough for simple modeling, especially when it comes to scripting, and has been for 10 years already.

Solidworks is $48/year for hobbyists though, and Fusion is free.
Post reply on HN