Live data from Hacker News

Parametric CAD in Rust

campedersen.com

61–70 of 184 posts

Re: Parametric CAD in Rust

#61
post #28

Earlier quoted context omitted.

You're correct, I'm completely uneducated! Pull requests welcome :)

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…

>I still feel like there's an unexplored space where you combine the benefits of both somehow though. Like a code-based CAD but it also has a GUI editor that stays in sync and avoids the need to type in coordinates by hand. That would be extremely difficult though.

I think you can do this if the data representation of operations and values is human readable. The simplest implementation would restrict the language/data format to operations representable in the gui.

Unlike trying to solve the "visual programming" problems, we don't need or desire Turing completeness.

Very interesting indeed!

Re: Parametric CAD in Rust

#62
post #2

Unfortunately, using a geometry kernel [1] that operates on triangle meshes means this is a no-go for serious CAD usage. [1]: https://github.com/elalish/manifold

My whole CAD experience is with OpenSCAD, which apparently uses the same kernel; Honest question -- what is the alternative? I would assume the vast majority of 3D model processing relies on triangle meshes...

Meshes are an output, not a source, and not a good internal representation.

Meshes are only a lossy approximation of the actual geometry, and the errors accumulate as features reference off of earlier features.

A simple example is a line tangent to an arc. The line will only be the correct distance from the center of the arc at one point (one angle) per segment.

In openscad you don't notice the problem because since it's code and you have variables and programming ways of expressing relationships, you would usually not try to derive one thing from another by geometry, instead both things would reference a common ancestor variable. But that's a technical implimentation detail that works around the problem by just not doing a thing that doesn't work. The problem is still there that a valid geometry constraint would produce invalid results.

Re: Parametric CAD in Rust

#63
post #28

Earlier quoted context omitted.

You're correct, I'm completely uneducated! Pull requests welcome :)

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?

Re: Parametric CAD in Rust

#64
post #28

Earlier quoted context omitted.

You're correct, I'm completely uneducated! Pull requests welcome :)

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…

> Like editing an SVG in notepad instead of Inkscape.

Speaking of which, I would love to have parametric capabilities in Inkscape.

Re: Parametric CAD in Rust

#65
post #51
post #26

SketchUp was my go to for a while but I'm done with parametric personally, trying to fix meshes for 3D printing... time I grow up and use something like Fusion360 seems like or onshape. Still it was good/simple enough for non-round shapes in SketchUp except they have some kind of memory leak/bug at least for the 2017 version. But I guess quit being cheap and buy a modern copy on my part. Edit: oh I guess sketchup is…

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.

Re: Parametric CAD in Rust

#66

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…

[dead]

Re: Parametric CAD in Rust

#67
Not to crap on this project too much, but this, and most of the other small CAD projects that get posted here, always have a condescending, "Look how easy I've made this" vibe to them, and then they're always light years behind modern CAD software.

If you're doing serious CAD work, like designing a whole machine, or working with multiple vendors to get parts manufactured, then it really is worth paying for a commercial CAD system and learning how to use it. All of the commercial CAD systems today support parametric modelling where later operations are updated automatically when the earlier operations are changed by the user.

If you insist on writing code, then even entry level systems like SolidWorks have APIs to do everything from creating the part geometry, defining geometric tolerances and PMI, running simulations, doing different types of analysis, creating machine/tooling instructions (G-code, etc.), exporting to various formats, and a million other things.

And they have workbenches for manufacturing techniques other than 3D printing, like sheet metal, CNC machining, cable routing, injection molding, welding, etc. And most of them have libaries of standard and off the shelf parts, like screws, bolts, nuts, washers, cables and housings, etc. in various standardized sizes so you don't have to model those at all.

For testing, on the higher end, the CAD systems integrate with metrology hardware and they're able to actually measure the manufactured parts and compare against the model to validate that they have the correct shape and meet all of the tolerances. Not as a virtual unit test running in CI, but by actually measuring the physical part.

Re: Parametric CAD in Rust

#68
post #27
post #6

Interesting, because I am trying to learn OpenSCAD for some simple modeling.

definitely learn solidworks or something in that vein first that, and as a prior skill, learn to draw by hand on paper orthogonal and isometric views of 3d objects. cad is another theory building excercise, but instead of being about processes, its about objects. you want to start from a strong manual/first principles base

I liked CATIA, but can't afford it at the moment.

Re: Parametric CAD in Rust

#69
post #28

Earlier quoted context omitted.

You're correct, I'm completely uneducated! Pull requests welcome :)

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…

This is actually what onshape is, under the covers.

The GUI is really just using their scripting primitives, etc. You can access it the same as they can, actually.

Re: Parametric CAD in Rust

#70
post #59

Why not use OpenSCAD?

Because it is not written in Rust, I suppose. Anyway, I think using only code for designing 3D objects is a poor design choice. You really need something that is between pure code and pure GUI.

I would really like to see someone work that up.

I suspect that Moment of Inspiration and Rhinoceros 3D are something along those lines, but I'm not aware of an opensource tool which hoes that row.

One thing in particular which it would be nice to see would be a facility where one could draw a piece of geometry, then all the coordinates/values which describe it could be displayed in a pane where they could then be named or re-arranged, or the values changed, or even the values changed into formulae.

Post reply on HN