Live data from Hacker News

Parametric CAD in Rust

campedersen.com

171–180 of 184 posts

Re: Parametric CAD in Rust

#171

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."

I agree with the OP:s statement

"With version control"

but there are 0 reasons you can't have that in a visual application as well.

It just needs good domain model design.

I mean it's _not_ trivial. To start with you have to first understand the relationships between your model entities, and how versioning strategy affects your model hierarchy (well, graph basically), and that potentially locks you down on a certain path. But it's totally doable as a hobby project (once you know CAD systems are built - so it's not suitable as ones first CAD project ofc).

Re: Parametric CAD in Rust

#172
post #106

Earlier quoted context omitted.

FWIW, the FLOSS CAD program SolveSpace can generate parametric sketches and export them as SVG files (file > export 2d view)

Is there a facility when doing this for controlling colour/fill?

SolveSpace does have some ability to control the color and fill of areas. It's nowhere near as powerful as Inkscape, but enough to make simple diagrams. The exported SVGs can also be edited in Inkscape.

Re: Parametric CAD in Rust

#173
post #111

Earlier quoted context omitted.

for simple learning, I invite you to consider SolveSpace

Has there been any work on it to make it usable w/ touch or a stylus or a trackpad? I'm on the verge of breaking down and buying a license for Moment of Inspiration 3D since it was designed for use on tablet computers (which is my preferred sort of hardware).

To rotate the view in SolveSpace, you need any one of these:

* a keyboard's shift key and a right mouse button, or * a middle mouse button, or * a 3D mouse.

I've done some work in SolveSpace with a Wacom tablet, by binding the stylus's buttons to the middle and right mouse buttons. SolveSpace is a pretty simple program, so you don't need to dig deep through the UI to get to all the functions. Lost of the often-used functions have keyboard shortcuts, but I don't think there is anything that is only accessible through the keyboard.

Depending on what you aim to do, you might be interested in keeping up with Blender's currently-in-development tablet mode:

https://code.blender.org/2025/07/beyond-mouse-keyboard/

Re: Parametric CAD in Rust

#174
post #171

Earlier quoted context omitted.

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."

I agree with the OP:s statement "With version control" but there are 0 reasons you can't have that in a visual application as well. It just needs good domain model design. I mean it's _not_ trivial. To start with you have to first understand the relationships between your model entities, and how versioning strategy affects your model hierarchy (well, graph basically), and that potentially locks you down on a certain…

Example of a CAD program/system which implements this?

Re: Parametric CAD in Rust

#175

Earlier quoted context omitted.

Onshape is just a GUI over the Parasolid geometric modeling kernel, the same kernel used by Solidworks [1]. Whatever their scripting primitives are, they're at best a thin wrapper over Parasolid (which is true for the entire industry - it's all Siemens Parasolid and Dassault ACIS). [1] https://en.wikipedia.org/wiki/Parasolid#Applications

Yes, this is all true, but the comment I responded to wanted to be able to basically code rather than GUI sometimes , but still have the GUI up to date. Because of how onshape was built it makes this very very easy. Solidworks very much does not. Fusion360 also has good enough python bindings but it's still nowhere near as easy or integrated to do this (or debug it) as onshape. So I'm kinda not sure what you are goin…

For folks who are curious about this, see:

https://cad.onshape.com/FsDoc/

My surmise is that this is tightly coupled with Parasolid, so it wouldn't be feasible to create an implementation of this language using some other CAD kernel?

Re: Parametric CAD in Rust

#176
post #172

Earlier quoted context omitted.

Is there a facility when doing this for controlling colour/fill?

SolveSpace does have some ability to control the color and fill of areas. It's nowhere near as powerful as Inkscape, but enough to make simple diagrams. The exported SVGs can also be edited in Inkscape.

Nice! (if memory serves, the last time this came up that wasn't possible)

Re: Parametric CAD in Rust

#177
post #169

Earlier quoted context omitted.

Usually when one needs constraints one can code it up as a recursive function.

That’s certainly not the case for most situations where a constraint solver is useful

Worked for the one time I needed it, and it seems to be a frequently used technique for folks using OpenSCAD.

Curious if something different could be achieved using Python....

Re: Parametric CAD in Rust

#178
post #173

Earlier quoted context omitted.

Has there been any work on it to make it usable w/ touch or a stylus or a trackpad? I'm on the verge of breaking down and buying a license for Moment of Inspiration 3D since it was designed for use on tablet computers (which is my preferred sort of hardware).

To rotate the view in SolveSpace, you need any one of these: * a keyboard's shift key and a right mouse button, or * a middle mouse button, or * a 3D mouse. I've done some work in SolveSpace with a Wacom tablet, by binding the stylus's buttons to the middle and right mouse buttons. SolveSpace is a pretty simple program, so you don't need to dig deep through the UI to get to all the functions. Lost of the often-used f…

Yeah, that's the problem --- Samsung colludes w/ Wacom to deny right-click functionality to their devices using the S-Pen --- really, really, really miss that some days.

I'll keep experimenting w/ this in mind for the next time I'm using my Wacom One attached to my MacBook.

Re: Parametric CAD in Rust

#179
post #171

Earlier quoted context omitted.

I agree with the OP:s statement "With version control" but there are 0 reasons you can't have that in a visual application as well. It just needs good domain model design. I mean it's _not_ trivial. To start with you have to first understand the relationships between your model entities, and how versioning strategy affects your model hierarchy (well, graph basically), and that potentially locks you down on a certain…

Example of a CAD program/system which implements this?

Version control?

Quite a few with their domain specific naming conditions, constraints and workflows.

For example Fusion 360 https://www.autodesk.com/products/fusion-360/blog/fusion-360...

Then there's stuff like "Tekla model sharing" https://www.tekla.com/products/tekla-model-sharing

Onshape https://cad.onshape.com/help/Content/versionmanager.htm

Etc

The requirement to a) collaborate b) version the work is quite old and well supported industrially. Depending on the application it may not "look or feel" that nice of course.

I guess the key thing is these are not "code first" offerings.

Re: Parametric CAD in Rust

#180
post #179

Earlier quoted context omitted.

Example of a CAD program/system which implements this?

Version control? Quite a few with their domain specific naming conditions, constraints and workflows. For example Fusion 360 https://www.autodesk.com/products/fusion-360/blog/fusion-360... Then there's stuff like "Tekla model sharing" https://www.tekla.com/products/tekla-model-sharing Onshape https://cad.onshape.com/help/Content/versionmanager.htm Etc The requirement to a) collaborate b) version the work is quite old…

I was more thinking opensource options now that Ondsel has folded, but appreciate the information.
Post reply on HN