Parametric CAD in Rust
Posted by ecto 1 day ago
Comments
Comment by rkagerer 1 day ago
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).
Comment by fainpul 1 day ago
As the author says:
"I wanted to write my parts the way I write firmware. In Rust. With types. With version control."
Comment by nkrisc 1 day ago
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.
Comment by alnwlsn 1 day ago
https://github.com/settinger/selectric_typeballs
A bit like how you can edit images in MS Paint, Python, or Photoshop. None of these is or should be a one size fits all solution.
Comment by fsloth 13 hours ago
"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).
Comment by WillAdams 6 hours ago
Comment by fsloth 6 hours ago
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.
Comment by WillAdams 5 hours ago
Comment by fsloth 3 hours ago
They chose maybe one of the toughest imaginable combinations for a business model. Viable open source businesses are hard (since you don’t own your ip in closed form, hard to explain to investors what the actual value is). 3D businesses are hard.
So it’s hard x hard.
Clearly their _tech_ worked. I guess there is a lesson here - better mousetrap is almost never enough for a viable business.
Comment by fsloth 1 day ago
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)
Comment by tatqx 1 day ago
Comment by skinner927 1 day ago
Comment by embedding-shape 1 day ago
Agree, it's really hard to do work where you leverage "feels right" together with code, because even if the iteration loop is really tight ("change a bit of code > look at the results"), it's still loose compared to just clicking and dragging, feels like the mental load is a lot less.
Environment art really changed and became a lot easier with VR, I think maybe it's mostly a perspective thing, adjusting with controllers and dragging a moving is great, but the perspective it gives you really has no comparison and makes it all a lot simpler to get right. I can't wait for the tooling to mature more.
Comment by bob1029 1 day ago
Comment by johnwalkr 1 day ago
Comment by dgroshev 1 day ago
I think it's partially a positive feedback loop: the "hacker" tools (OpenSCAD) influence the aesthetic (blocky/square brackets, like in the post), which in turn influences the tools. When creating a simple fillet or a chamfer is an annoying exercise in constructive geometry rather than five mouse clicks, there'll be fewer fillets, chamfers, and flowing surfaces, even when they make mechanical or manufacturing sense; but then that becomes "the look", and people don't even think about fillets.
Comment by WillAdams 20 hours ago
https://wefab.ai/blog/chamfer-vs-fillet-in-3d-printing-a-des...
Comment by dyauspitr 1 day ago
Comment by MITSardine 1 day ago
Comment by gmac 1 day ago
Comment by MITSardine 1 day ago
Comment by etskinner 1 day ago
> 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 realize the bolt pattern is 2mm off, you just edit that dimension and let the CAD program recalculate. You don't need to click around for an hour again. That's the beauty of contstraint-based parametric modeling as opposed to, say, modeling in Blender.
The author's program is akin to writing vim to replace Publisher. They're solving entirely different problems. Not to mention, this code-as-model paradigm already exists: OpenSCAD
Comment by bangaladore 1 day ago
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.
Comment by tomcur 1 day ago
A C++-library to be aware of is SolveSpace's slvs: https://github.com/solvespace/solvespace/tree/e74c2eae54fdd9....
Comment by throwup238 1 day ago
Constraints and parametrizing are the trivial parts of CAD, something you can now implement in a weekend with Claude Code, the MINPACK/SolveSpace test suite, and OpenCascade as an oracle. The hard part is a geometric kernel that can express boundary representations for complex shapes (sketches, chamfers, fillets, etc) and boolean operations while somewhat handling the topographical naming problem without driving the user insane (which existing kernels are still all shit at).
Comment by delusional 1 day ago
You go ahead and try that.
Comment by throwup238 1 day ago
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 ACIS in the literature or open source.
Comment by MITSardine 1 day ago
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).
Comment by dymk 1 day ago
Comment by nancyminusone 1 day ago
Comment by imtringued 1 day ago
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 derivative of the minimum of a function is zero, it can be used for solving convex optimization problems.
Levenberg-Marquardt is another way to solve optimization problems.
The Powell dog leg method is new to me, but it is just an extension of Gauss-Newton which you could think of a special casing of Newton-Raphson where the objective function is quadratic (useful for objectives with vector norms aka distances between positions).
Most of the algorithms require solving a linear system for finding the zero of the derivative. The Schur complement is a way to factor the linear system into a bunch of smaller linear systems and sparse QR/Cholesky are an implementation detail of solving linear systems.
Now that we got the buzzwords out of the way I will tell you the problem with your buzzwords. Constraint solving algorithms are SAT or SMT based and generally not optimization based.
Consider the humble circle constraint: a^2 + b^2 = c^2. If you have two circles with differing centers and radii, they may intersect and if they do, they will intersect at two points and this is readily apparent in the equations since c = sqrt(a^2 + b^2) has two solutions. This means you will need some sort of branching inside your algorithm and the optimization algorithms you listed are terrible at this.
Comment by tomcur 1 day ago
Comment by cindyllm 1 day ago
Comment by imtringued 1 day ago
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.
Comment by WillAdams 1 day ago
Comment by ecto 1 day ago
Comment by IshKebab 1 day ago
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 still feel like there's a 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.
Comment by dang 22 hours ago
Ouch. Please don't attack someone's work this way. It's too aggressive and against the site guidelines: https://news.ycombinator.com/newsguidelines.html.
I'm sure you didn't intend it as an attack, but it's easy to cross into poisoning the community without meaning to. Many people have been hounded into abandoning HN because of this type of swipe, or at least into never sharing their work here. We all lose when that happens.
It's a pity, because what you wrote was otherwise a fine contribution. if you had begun your comment at the good part ("It looks like a nice alternative [etc.]") it would have been great.
Comment by DannyBee 1 day ago
The GUI is really just using their scripting primitives, etc. You can access it the same as they can, actually.
Comment by throwup238 1 day ago
Comment by DannyBee 1 day ago
So I'm kinda not sure what you are going for here. The fact that they are all the same kernels under the cover is sort of irrelevant. It's not that thin a layer and the layer matters a lot since it is what you get to use. It's like saying all of userspace is just syscalls. That's not what users see or interact with, the layer they interact with matters a lot to them.
Comment by WillAdams 6 hours ago
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?
Comment by throwup238 1 day ago
Comment by squeedles 1 day ago
Parasolid was v1 and old school C, then they got the C++ bug like many of us at the time and did ACIS as v2.
Comment by amelius 1 day ago
Speaking of which, I would love to have parametric capabilities in Inkscape.
Comment by fainpul 1 day ago
Comment by WillAdams 1 day ago
Comment by TheTaytay 1 day ago
Comment by avhon1 1 day ago
Comment by WillAdams 1 day ago
Comment by avhon1 12 hours ago
Comment by WillAdams 6 hours ago
Comment by hyperbrainer 1 day ago
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 with this for most stuff. Also, this stuff is easily solved by things like the component library and configurations.
Comment by IshKebab 1 day ago
Because I don't live in America?
Comment by bluGill 1 day ago
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.
Comment by dymk 1 day ago
Comment by hyperbrainer 1 day ago
Comment by aaronblohowiak 1 day ago
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!
Comment by prennert 1 day ago
Draw your free-hand shape in Inkscape, export to SVG, import it in FreeCAD and go from there.
I used that trick to trace a part from an image and it worked surprisingly well. Not very efficient compared to commercial tooling, but despite the clumsiness its fairly intuitive and free.
Comment by jfindley 1 day ago
Comment by NonHyloMorph 1 day ago
Comment by dymk 1 day ago
Comment by WillAdams 1 day ago
https://moi3d.com/forum/messages.php?webtag=MOI&msg=11614.11...
Comment by jetter 1 day ago
Comment by gwbas1c 1 day ago
> One thing I care about that most CAD tools don't: vcad is designed to be used by AI coding agents.
Comment by amelius 1 day ago
Comment by neomantra 1 day ago
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
Comment by storystarling 1 day ago
Comment by ilogik 1 day ago
Comment by dymk 1 day ago
Comment by WillAdams 1 day ago
Comment by dymk 20 hours ago
Comment by WillAdams 6 hours ago
Curious if something different could be achieved using Python....
Comment by hnuser123456 1 day ago
Comment by b38tn1k 1 day ago
Comment by davidmedin 1 day ago
Comment by rnhmjoj 1 day ago
Do you know how it compares?
Comment by ecto 1 day ago
Comment by gwbas1c 1 day ago
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.
Comment by Cargo4286 1 day ago
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/Comment by asimeqi 1 day ago
Comment by Cargo4286 1 day ago
Comment by gwbas1c 1 day ago
Comment by kibwen 1 day ago
Comment by Cargo4286 1 day ago
Comment by mountainriver 1 day ago
Comment by ozy 1 day ago
Comment by avhon1 1 day ago
FreeCAD can do this. So can all of the proprietary parametric CAD programs I've ever used, some of which (PTC OnShape, Siemens Solid Edge, Autodesk Fusion) have usable free tiers available.
Comment by bluGill 1 day ago
FreeCAD is designed for the things real designers really do. OpenSCAD is designed for the things mathematicians do.
Comment by KiwiKid 1 day ago
Math doesn't go away tho
Comment by zefhous 1 day ago
https://github.com/BelfrySCAD/BOSL2/wiki/attachments.scad#se...
Comment by ginko 1 day ago
Comment by jas8425 1 day ago
> 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 misreading things?
Comment by wrl 1 day ago
Hard pass.
Comment by ecto 1 day ago
Comment by xyzsparetimexyz 1 day ago
Comment by askl 1 day ago
Probably not.
There's also this at the bottom.
> One thing I care about that most CAD tools don't: vcad is designed to be used by AI coding agents.
Comment by Gerharddc 1 day ago
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...
Comment by nynx 1 day ago
Comment by bigfishrunning 1 day ago
Comment by Brian_K_White 1 day ago
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.
Comment by nynx 1 day ago
Comment by pca006132 1 day ago
Comment by MITSardine 1 day ago
Comment by bob1029 1 day ago
Comment by nicr_22 1 day ago
Comment by avhon1 1 day ago
Comment by WillAdams 1 day ago
but then the author used the source directly as noted in the Github footnote:
>I ended up directly using solvespace's solver instead of the suggested wrapper code since it didn't expose all of the features I needed. I also had to patch the solver to make it sufficiently fast for the kinds of equations I was generating by symbolically solving equations where applicable.
Comment by autumn-antlers 1 day ago
Comment by xixixao 1 day ago
Comment by nynx 1 day ago
Comment by bigiain 1 day ago
I do agree that historically, software aimed at building 3d models for games/animations and other digital use was usually called modeling and not cad. I'm thinking of software like 3D Studio Max back in the 90s here.
https://en.wikipedia.org/wiki/CAD/CAM
I notice though that the Wikipedia article for CAD says: "This software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing."
Comment by dgently7 1 day ago
like I can model a table that is the right size and looks like it will not tip over for my game, but I am going to cad that table to run a stress sim and make the plans for building it for real.
though id still call the action of doing the building in the cad software "modeling"... so idk.. language is weird.
so software that lets you work accurately with measurements and real units == cad. (fusion360) software that just makes geometry == modeling. (blender)
but if you wanna go get real confused look at "plasticity" an app targeted at "modeling" but uses a cad engine and sells itself as "cad for artists" it has real scale measurements and everything too.
Comment by ezst 1 day ago
Comment by hambes 1 day ago
Comment by WillAdams 20 hours ago
Comment by ge96 1 day ago
Edit: oh I guess sketchup is a surface modeler weird thought it was parametric this whole time, lol someone else said it's a polygon modeler
Yeah I don't know what parametric modeling is apparently, I use a mouse/calipers to model stuff not parameters
There is a solid validator plugin you use before you export an STL to make sure the mesh is closed/a manifold
Comment by Animats 1 day ago
Ah. That's what's doing the constructive solid geometry. Here's the 2009 PhD thesis behind the object merge and difference algorithms inside Manifold. Nice. At last, soundness. This is a long-standing problem. And now there's an open source implementation. Manifold itself is in C++, not Rust, though.
None of this is parametric. That's a different problem. That's where you put in constraints such as A is perpendicular to B, B is 100mm from C, etc., and the constraint solver tries to satisfy all the constraints. Change a dimension and everything adjusts to preserve the constraints. Parametric CAD is all about constraint solving and expressing conflicts to the user. Autodesk Inventor, Fusion, etc. have good constraint solvers.
[1] https://github.com/elalish/manifold/blob/master/docs/RobustB...
Comment by MomsAVoxell 1 day ago
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.
Comment by Animats 1 day ago
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.
Comment by avhon1 1 day ago
OnShape and Fusion360 are fully parametric CAD programs. Another free-tier closed-source one is Siemens Solid Edge (the "Hobbyist" edition). FLOSS parametric CAD programs that are reasonably usable are FreeCAD (complicated but powerful) and SolveSpace (an 80/20 sort of tool -- nowhere near as powerful, but vastly easier to use).
Comment by ge96 1 day ago
Comment by IshKebab 1 day ago
Comment by maartenh 1 day ago
I only know of another text -> STL AI model, I'm quite a bit more excited about this idea.
Does someone have experience with this?
Comment by storystarling 1 day ago
Comment by amelius 1 day ago
Comment by oussama-gmd 1 day ago
Comment by Gud 1 day ago
Comment by vbezhenar 1 day ago
This approach is explored by OpenSCAD. No need to reinvent the wheel. But parametric CAD is much more than that.
Comment by kivarada 1 day ago
Comment by codetiger 1 day ago
Comment by hahahahhaah 1 day ago
Comment by amelius 1 day ago
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.
Comment by yehoshuapw 1 day ago
(I also totally agree about the gui being worth having sometimes, and would have loved the ability to fully mix. Code as the main driver, but gui to help choose it. For example to figure out faces and other attachment stuff)
Comment by WillAdams 1 day ago
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.
Comment by yuumei 1 day ago
Comment by librasteve 1 day ago
Comment by anon291 1 day ago
> 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.
Comment by WillAdams 1 day ago
Comment by d_silin 1 day ago
Comment by 8note 1 day ago
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
Comment by d_silin 1 day ago
Comment by nomel 1 day ago
Both have really great documentation/examples.
Comment by avhon1 1 day ago
Comment by WillAdams 1 day ago
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).
Comment by avhon1 12 hours ago
* 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:
Comment by WillAdams 6 hours ago
I'll keep experimenting w/ this in mind for the next time I'm using my Wacom One attached to my MacBook.
Comment by the__alchemist 1 day ago
Comment by numpad0 1 day ago
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 precision that it readily translates to a .gcode file to be printed. That requires a good amount of useful neurodivergence to pull off at all.
Comment by WillAdams 1 day ago
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.
Comment by whilenot-dev 1 day ago
Comment by dgroshev 1 day ago
Comment by avmich 1 day ago
However purely programmatic interface allows doing surprising things which might be hard to achieve with a mouse.
Comment by WillAdams 1 day ago
Comment by ecto 1 day ago
Comment by the__alchemist 1 day ago
Comment by mobiuscog 1 day ago
Comment by WillAdams 1 day ago
Comment by kingstnap 1 day ago
I specifcally had it spit out a FreeCAD macro, which is basically Python that looks like what you've made.
Comment by FpUser 1 day ago
FreeCad is getting somewhere but it is still way behind. The last thing I care about is what language was it implemented with.
Comment by WillAdams 1 day ago
There is a soft-fork which adds Python:
which I've found quite useful: https://github.com/WillAdams/gcodepreview in particular, working up a facility to write out DXFs w/ arcs
Comment by jlarocco 1 day ago
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.
Comment by zombot 1 day ago
Fucking A Right!
Comment by 20lives 1 day ago
Comment by asdfaslkj353 1 day ago
Comment by ecto 1 day ago
Comment by tuetuopay 1 day ago
Please have a check on a different monitor and browser than you are currently using, as most of the article is unreadable. Code blocks are nigh unreadable, and the screenshots are washed out as if they were HDR with improper tone mapping (I tested both with Firefox on Linux and Safari on iOS).
It's a shame, because it made me gloss over the article.
Oh, and the screenshots have the same issue both on the blog post and on the main vcad.io website. Funnily enough, code snippets on vcad.io have proper readable colors as opposed to your blog (they're still too dim to be comfortable though, but they're readable).
Comment by asdfaslkj353 1 day ago
Comment by vhantz 1 day ago