Live data from Hacker News

Parametric CAD in Rust

campedersen.com

131–140 of 184 posts

Re: Parametric CAD in Rust

#131
> Every render in this post was made that way. Claude generated the geometry with vcad, imported each STL/GLB into Blender via MCP, set up studio lighting, and rendered to PNG. No human touched Blender.

This seems a bit wasteful to me. Why do you need an LLM to do the part of controlling Blender? Can't normal code be used to automate this instead? And save a scary amount of electricity in the process...

Re: Parametric CAD in Rust

#132

The opening paragraph is very telling; the author doesn't seem to understand typical pro-level parametric CAD programs available on the market: > I keep designing physical parts for our robots. Motor mounts, sensor brackets, wheel hubs. Every time, the workflow is the same: open a GUI CAD program, click around for an hour, export an STL, realize the bolt pattern is 2mm off, repeat. This doesn't make sense. When you r…

> That's the beauty of constraint-based parametric modeling as opposed to, say, modeling in Blender. I was thinking the same thing. This looks more like an API that makes 3d modeling look closer to CAD, but without realizing that CAD is about constraints, parametrizing, and far more.

We've started a 2D geometric constraint solver at https://github.com/endoli/fiksi doing the constraint part of this in Rust. We're using it internally and so far it works well, though it's still experimental. More constraints and especially better behavior around failure are needed. The latter will likely entail at least doing more with degree of freedom counting, though there's some of that already.

A C++-library to be aware of is SolveSpace's slvs: https://github.com/solvespace/solvespace/tree/e74c2eae54fdd9....

Re: Parametric CAD in Rust

#133

The opening paragraph is very telling; the author doesn't seem to understand typical pro-level parametric CAD programs available on the market: > I keep designing physical parts for our robots. Motor mounts, sensor brackets, wheel hubs. Every time, the workflow is the same: open a GUI CAD program, click around for an hour, export an STL, realize the bolt pattern is 2mm off, repeat. This doesn't make sense. When you r…

If you like OpenSCAD, you should check https://modelrift.com which is an OpenSCAD browser-based IDE which uses LLM to generate .scad and instantly shows the .stl 3d model result via 3d model viewer. Since AI models are still not good at openscad, the useful feature of modelrift is the "screenshot-powered" iteration where human annotates visual problems and sends it back to AI assistant to fix, all using hotkey shortcuts.

Re: Parametric CAD in Rust

#134

Earlier quoted context omitted.

;) 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…

Look, I'm not trying to decimate you here but your list of keywords is wrong and I know it because I explored that list last month for a completely different application. The Jacobian is the first order derivative for a function that accepts a vector as an input and produces a vector as an output, hence it must be a matrix. Newton-Raphson is an algorithm for finding the roots(=zeroes) of a function. Since the derivat…

Optimization can work well for interactive CAD usage, because geometric sketches tend to be close to the intended solution, and it's fast. It also has the nice property of stability (i.e., with optimization, small changes in parameters tend not to cause large perturbations in the solution). Doing more gets into what you mentioned, and is called chirality or root identification in the literature. That's much more intense computationally, but could be useful especially if cheaper approaches like optimization failed.

Re: Parametric CAD in Rust

#135
post #90

If anyone is interested, you can try EngineeringSketchPad ( https://acdl.mit.edu/ESP/ ) which is very similar but much more mature. It also supports simple geometric primitives and boolean operations via a scripting language, but also more general rational curves and surfaces (i.e. BREPs). It has other nice features like differentiation, application-specific views (think structural vs CFD), and an attention to water-…

The certificate just expired, so mobile Safari is not willing to let me see it. :(

I should have shared this more recent page directly on the manual with examples to begin with: https://flexcompute.github.io/EngineeringSketchPad/EngSketch...

Re: Parametric CAD in Rust

#136

Earlier quoted context omitted.

> That's the beauty of constraint-based parametric modeling as opposed to, say, modeling in Blender. I was thinking the same thing. This looks more like an API that makes 3d modeling look closer to CAD, but without realizing that CAD is about constraints, parametrizing, and far more.

This is something I don't get about the code-based CAD tools. They don't let you specify declarative geometric constraints. Constraints are useful beyond just designing parts. If you have a parallel mechanism there are only two ways to solve the kinematics/dynamics for it: Constraint solving for rigid contacts or iterative solving by approximating the model with non-rigid contacts via internal springs.

Could you mock up some code to describe which you feel would be suitable to describing such a thing?

Re: Parametric CAD in Rust

#137
post #64

Earlier quoted context omitted.

> Like editing an SVG in notepad instead of Inkscape. Speaking of which, I would love to have parametric capabilities in Inkscape.

https://graphite.art/ https://paragraphic.design/

Note that Graphite does _not_ work with a stylus --- in the web version the input is too jerky/disjointed, for the desktop, it won't react to a stylus in any fashion at all (for the Windows version).

Re: Parametric CAD in Rust

#138
post #25

What's nice about this is that it allows for programmatic CAD, enabling things like web applications that can download an .stl file based on user input. I hope I can find a weekend or two to play with it. BTW: I spent a few weekends playing with Microcad ( https://microcad.xyz/ ). It was cool, and had a similar rust feel. I just, for the life of me, couldn't figure out how to do 3d ellipses.

Here's an ellipsoid in build123d using geometric transformation of a sphere: from build123d import * mat = Matrix([[2,0,0,0],[0,1.5,0,0],[0,0,0.5,0]]) ellipsoid = Sphere(100).transform_geometry(mat) Also, FYI build123d now runs in the browser thanks to OCP.wasm. Example playground here https://jojain.github.io/build123d-sandbox/

build123d isn't Microcad

Re: Parametric CAD in Rust

#139
post #97

Earlier quoted context omitted.

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.

A more affordable option is Moment of Inspiration 3D (written by the same dev who did Rhino originally) which also has a node editor available:

https://moi3d.com/forum/messages.php?webtag=MOI&msg=11614.11...

Re: Parametric CAD in Rust

#140
post #98
post #37

Earlier quoted context omitted.

For that there’s openscad

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

Usually when one needs constraints one can code it up as a recursive function.
Post reply on HN