CADing and 3D printing like a software engineer
fangpenlin.com
fangpenlin.com
So if you want (need) to create parametric CAD parts and can program this might interest you: https://cadquery.readthedocs.io/en/latest/quickstart.html#qu...
I e.g. used it to create parametric electronic parts for visualizations of printed circuit boards where modelling each slightly differently sized variant manually was too much effort.
Best resources to get a feel of why programmatic parametric modeling is so interesting:
I think CadQuery/Build123D are fine tools with much better abstractions than OpenSCAD. The latter is not, IMO, really a CAD tool at all; at no point does the Computer Aid the Design, in the CAD sense, whereas you can argue that the various OpenCascade code-CAD environments can at least expose generated geometry to code.
But the post is right: parametric GUI CAD is pretty much a visual analogue of functional programming. Once you get your head around the ways sketches or their equivalents can map onto existing geometry, a lot of the ways programmers think are very applicable to CAD.
You're basically working with a directed graph, which means you can do things like drive designs from parameter sets, or spreadsheets, and e.g. in FreeCA drive some variables from configuration tables (rows in a spreadsheet with different parameter sets) so you can make variations of objects.
As much as I think code-CAD has uses, especially perhaps for analysing and post-processing STEP files for download customisers, at this point someone with parametric CAD requirements should at least try a GUI CAD package like FreeCAD or any of the free/low-cost tiers of the commercial packages. FreeCAD can do OpenSCAD, and has a (verbose) Python layer, so it's accessible to code CAD.
The tools may initially be a little frustrating for programmers used to writing code, athough IMO less frustrating than the many quirks and significant limitations of OpenSCAD. But CAD methodology is logical and scaleable, and with a little learning you will be able to do things much more quickly and much less repetitively than OpenSCAD, which admittedly is a counterintuitive claim to a programmer.
I think programmers tend to think that GUI CAD must be to code-CAD what visual programming tools are to text IDEs: unnecessary fuss keeping you from the truth. But it's really not like that.
For example, you cannot write a routine that says "get me the edges of this object generated by this other routine, and apply a 1mm fillet to them all". Because while the code manipulates geometry, the result is not geometry. The result is a 3D approximated picture of the geometry rendered in another form of geometry.
To do anything like operate on result vertexes or edges you have to replicate the result geometry, by hand, in data structures in the code.
So it is not just fillets as an operation that are missing. It is any notion of being able to access the edges that you would wish to fillet.
This is why I think OpenSCAD does not "aid design" in the CAD sense. It does nothing but compile your wishes into a mesh. The most basic notion of "aiding design" ought to be exposing the result geometry of one operation so it can be used as the variable input for another.
Is it good for quickly understanding basic geometry or displaying the results of formulae? Yeah. Undeniably so.
I worked alongside people using early versions of Makerbot and Ultimaker, and those were a maintenance nightmare. But recently I got a Kobra 2 Pro for $200, and it's both more capable and easier to use than those old monsters. With PLA it's pretty much hassle-free, no need to tweak anything except print orientation and maybe some support options.
> users who generate less than $1,000 USD in annual revenue and use for home-based, non-commercial projects only.
Which already makes it unsuitable for any Open Source work. While one might still accept those restrictions for quick one-off projects, those projects are also the ones that FreeCAD can handle fine.
For simple things you can have all your components in a single file and make do but I rather dislike working this way for a ton of reasons.
I’m thinking about solid works when my fusion license expires. At least I’ll own my files and be able to manage them on my own ssd.
I'm a pretty happy FreeCAD guy, actually -- my issues are not FreeCAD but learning design -- but I will be trying it too.
I'll reconsider the $24/yr Solidworks deal now...
I print mostly practical parts so perfection isn't really needed but the finish has been great regardless. The only issues I have had is the bed eventually peeled up after enough PETG prints with no bed prep.
FreeCAD is capable and is indeed free, but as a beginner designing something somewhat complex it really led me into building a rat's nest of a project that I found difficult to salvage. The rough edges and general flaky behavior did not help things, and I found almost none of the user interface intuitive. If I had to do it over again I'd choose F360 or Onshape.
It seems to put off even people who are interested in learning CAD or are already familiar with CAD. It's telling that the best description people can come up with is "capable and free" instead of "easy to use".
I don't know why it particularly needs to be the freely available thing that corners "easy to use", when Tinkercad does that admirably.
With a good introduction, you can get into it and really work on your own designs in a tool nobody can take away from you or nickel-and-dime out of your hands by varying the free offer. You can run it on all of your own hardware forever. And you will actually learn core things about CAD.
The community is good. There's an absolutely amazing number of good free tutorials now; the problem of bad tutorial material is a receding issue. I have not seen anything for Fusion 360 that even comes close to being as transparent, up-front, broadly educational, clickbait-free and informative as the Mango Jelly Solutions tutorials for FreeCAD.
I do consider it a lifestyle choice, still. But then so many creative things are open-ended, freely available/documented challenges, rather than easy. Many rich experiences do not have an easy entry point with early success.
I am a mostly very happy FreeCAD user. It is something that costs me no money but has allowed me to make tools unique to me that have changed my creative life forever.
All the same I'm about to pick up the Solidworks for Makers plan for a year, because I think it's always learning a thing from multiple different perspectives. I don't particularly expect to be swayed, but I do have future plans that involve being a bit more knowledgeable about the other packages. Solidworks is where I am going to start.
There are pretty significant changes to the "fit" of the UI, better preference panels, but there are also significant improvements to UI and tooling in Sketcher, the TNP mitigations mean attaching sketches to surfaces is broadly as safe as it is in other CAD packages, you can directly extrude edge selections in Part Design, there is support (not enabled by default) for multiple separate solids in single bodies in Part Design, pretty major changes in the CAM workbench and architecture workbenches etc.
Most significantly in a workflow sense there's a new core Assembly workbench; combined with the TNP mitigations that is an enormous change.
https://www.youtube.com/watch?v=7Dj3p1nCmrE
It's very much not just "under the hood".
Still more things to fix -- lots of stuff has already changed in the 1.1-dev weekly builds.
(Gets even better in 1.1, too -- and there are new changes coming to the core datums)
I personally don't think overall UX is the biggest problem, if you're prepared to learn it. I've used much worse software than this, and I think a lot of people are just moaning that it isn't "immediate" or "easy". I particularly don't understand criticism of it from the OpenSCAD direction: that's often just misinformed whining from people who hate GUIs and don't believe they can offer anything over text.
Since the new Assembly workbench and the TNP mitigations were added I think it's on pretty solid footing; you can do many things more easily in Part Design now than before, based on geometry edges rather than sketch edges.
One thing I would suggest is using the tab bar workbench selector rather than the dropdown: for some reason that makes the whole thing so much more fluid.
The biggest problem is still, ultimately, robustness.
This is not a problem F360 shares, and that feature is what you pay for.
There were always workarounds that made it possible to do what you say: you could offset your sketches from base planes rather than attach them to generated geometry, and otherwise avoid using generated geometry by making use of parametrics.
Once you knew how it wasn't particularly onerous. For a couple of years of 0.20 and 0.21 I had no TNP-related breakage because of this.
(There could be some problems with assemblies that were a bit more challenging.)
However, this is now essentially a solved problem in 1.0. There's a high level of mitigation in a stable face-naming algorithm that keeps track of the changes OCC creates. There are still edge cases being reported, but the implementation works well. I've stopped worrying about applying the normal base-planes technique.
(There are still edge cases of TNP in other CAD packages, even those built on Parasolid, because it's a research-grade problem; once you think about it in depth, it can never be "solved". It can only be mitigated to the point where the package usually does what you would expect.)
You can now sketch on faces, edit dependencies, make Pads and sweeps from solid geometry edges as well as sketch edges, refer to generated geometry in sketches, and see the subsequent features stay where they should be.
So this "main problem with FreeCAD" is essentially in the past, as it has been for a long time in the RealThunder branch where the mitigations were originally developed.
Another "main problem" -- the lack of a core Assembly workbench -- is also addressed.
The final "main problem" of FreeCAD, IMO, is that OCC's implementations of fillet, chamfer and thickness are less capable than other modern CAD systems; there are limitations regarding thick fillets on thin edges, essentially. It might be possible to get these improved upstream, or it might not be, but there are other ways to get fillets into your design (such as adding them in the sketches, where arguably any "functional" fillet should be anyway).
Anyone who used Blender in the early days knows how far its come. FreeCAD is making that journey too. The 1.0 release is a big step. I use FreeCAD for all of my (admittedly amateur) CAD work. I've designed toys for my kid, props for my Christmas light setup, tool-holders, and any number of things I can't think of at the moment.
If anyone is finding FreeCAD hard to pick up, I highly recommend Mango Jelly's Youtube channel, which offers lots of really great tutorials on using it: https://www.youtube.com/@MangoJellySolutions
I've had a 3D printer for a while, and I have to say that Bambu has completely changed my perspective on the whole experience.
Before, I treated it mostly as a time-consuming hobby - setting up my own Octopi for remote printing, tinkering with different settings and parts on my Prusa. It was all trial and error, with most prints turning out below average.
Now it feels more like a continuous integration system. It runs mostly unattended, always ready to execute my next batch of prints.
I recently traveled for a week and only needed my wife to refill the filament and remove finished prints, allowing my workflow to continue uninterrupted.
I don't regret my initial experience since I learned a lot, but I really appreciate having a more streamlined process now.
That's some sweet workflow optimisation. :)
I'd have tons more free time if I just outsource all the little tasks that keep me busy to my significant other.
Even the Prusa MK3 (upgraded to MK3S, then MK3S+...) required a Raspberry Pi to be able to print without lugging an SD card from my PC to the printer, and a USB webcam to add print monitoring.
Now when people ask for FDM printer recommendations, I tell them that this hobby has two main paths: One path regards the printer as a tool to create things for other projects; the other path has the printer as the project itself.
An analogy I use is buying a car that's working and ready to drive vs buying a car that doesn't work and repairing it. Are you looking to drive or are you looking to fix/build a car?
Bambu printers are an easy recommendation for a printer which is a tool. The new Prusa CORE One might be a good fit as well, but it's still too early to tell what its quirks are. For printers that are projects, the Ender 3 comes to mind as a very cheap base for countless tinkering and upgrades.
This is undeniably true at the youtube content level.
But at the printer level I think consumers will crash into this far less if buying the latest. Creality’s three new Ender 3 V3 models are all low-tinkering models, even the cheapest. So are the Anycubics. Sovol’s latest machines like the SV06 Ace manage to be both fully open source and also highly tuned out of the box.
As much as I admire the build quality of (most of) the Bambu Lab machines, in real terms what they have actually achieved is making the closed source, closed build, hard to upgrade and repair, RFID-chipped-consumables printer acceptable to the market. They even almost succeeded in making printing dependent on the cloud, until their little distributed industrial accident happened.
Another way I can tell that Bambu changed everything is through second-hand market prices. Before Bambu, I could sell most 3D printers for not much less than I purchased them or more, depending on the mods. I just struggled to sell a Voron 2.4 300 for $800 (near $1800 build price after extras). There is still a market for enthusiast printers, but the leap in user-friendliness is known. What they provided for the cost was a vast market leap.
You end up having to click and enter so many numbers if you need exact dimensions, so I'm planning on switching to cadquery.
It would be cool to make a framework for modifying cadquery code with natural language, for example "make box 1 and box 1 flush" or "create two concentric semi-spheres and subtract the smaller one from the larger one"
But idk, maybe once you're fast at fusion this kinda stuff is faster to hotkey than speak
The Spreadsheet module is awesome (particularly configuration tables, which I used even in one of my first serious designs) but I still don't really know why my model has to recalculate because I changed the background colour in a cell. That seems to me to be unnecessarily deep integration.
Coming at the problem from another end, I have have been designing dream houses as a hobby but have been struggling and frustrated by the current CAD and 3D editors.
There are a lot of drawing-house-plans apps like SweetHome3D and Homestyler etc, and they are all really good at getting some wall lines down quickly, but quickly start to get hard to do anything advanced and all give up on real roofs and attics.
From the other end there is Sketchup, which is both good and easy yet also difficult to control.
The general advice for people wanting to see a house design in 3D is to draw the plan in some house plan software then save that as a jpg and import that into sketchup and then to build the walls on top of the drawing etc.
Of course, being a programmer, I had some ideas... and have about a dozen abandoned starts on a house drawing program that actually understands that 'this is a wall, and this is how thick walls are' etc.
The openscad approach is good and I have some routines that do sensible tricky roofing angles and things, but you can't really go and and parameterise whole houses. Its a nut that still hasn't cracked.
I've watched and talked with a lot of architects and tbh they are sketching and treating their CAD as a bunch of lines rather than the CAD knowing what walls and beams really are.
It definitely tries to think about walls, rooms, windows, floors as they are meant to be modeled. You can even get a materials estimate based on the properties of the wall.
If you're talking to architects and they're talking about Autocad, and lines...they may be of the old guard. Most large/modern projects are Revit based. TBH any engineering drafting in 2024 using autocad is ridiculous. Something which takes 1-2 hours in a parametric modeller can take a day! Co-ordinating architecture, project management, structural engineering, facade engineering, and MEP specialties is non existent in Autocad - Revit is built for this.
Revit is built to "know" and "understand"...is more or less the de-facto standard for building information modelling. If your pockets are deep enough - i'd recommend it - they have an LT (light) version which is more affordable and may do everything you want - but it's still pretty expensive for a fun little side project.
At least in my country, there are a lot of small-project architects.
You're converting a loft into a bedroom? Building an extension to your house? You'll need to do the calculations to make sure the beam holding up the roof is strong enough, and some paperwork so the inspector can see the calculations have been performed, and enough plans that the builders know what to build. Basic requirements that AutoCAD can take care of just fine.
And of course these small-project architects are the only architects 99% of people will ever work with - far fewer people will ever work with an architect on a 100+ person building.
Interestingly, the company founded by the guy who developed the nailing plate which arguably made McMansions possible was an early investor in CAD, spending ~$1 million for one of the first systems.
Your benchy is almost a worst-case scenario (which is likely intentional) - because the coloured features are vertical, there will be several changes per printed layer. If you can constrain your material changes to layer boundaries you'll get a much better waste ratio.
A good example of this is printing coloured labels/features on a faceplate. So you print the whole faceplate in a single material, then switch material and print the highlight colour as raised features. That gets you a lot of result for a single material change. (On single-material printers there's a method where you strategically pause the print and swap the materials by hand. Learning lessons from that will really hammer home the mindset of optimising tool changes!)
There's a lot of lessons like this you'll pick up, where making your design sympathetic to the print process can have huge payoffs.
Additionally, printing any number of copies of the same multicolor object will result in the same amount of waste. This doesn't reduce the absolute amount of waste, just makes it a smaller % of the total material used.
Also worth looking into the "wipe into object" setting in the slicer, which will use the color changes in an extra model instead of purging them.
It's a little rough but I was able to get it to do what I needed it to! Here's my code: https://github.com/freeqaz/light-coil-model
Let me know if you want one. They're pretty rad!
Notably worse at the act of 'slinking'. Would tangle like no other!
For a non-circle that still works for slinky purposes, I'm sure some sort of geometric prism would be cool. Maybe I'll take a crack at it over winter break!
Meanwhile my colleague bought a Bambu Carbon for I think 2% of the price of my J35 and its such a brilliant machine. Fillament printers just seem to be getting better and better.
As an old-school software engineer, I would've been strongly tempted to solve this excess material problem with a file.
If you're on a budget, buy yourself BambuLab A1M, which is the best quality-to-money ratio.
https://arstechnica.com/gadgets/2023/08/3d-printers-print-br...
You can use it for 3d printing - but for engineering...nope. The Autodesk family of products / Solidworks are defacto for a reason - they have decades of tooling, libraries and so on that make lightwork of complex tasks. I'd tear my hair out trying to do my work in Blender which i easily do in Inventor, Autocad or Revit.
However, Blender was not meant to be a constraint based CAD/CAM package.
Solidworks still seems like the leader in offline mode, but parametric-everything FreeCad is evolving at an astonishing rate.
For critical professional work, gambling on opensource is still inappropriate most of the time. =3
But Blender is a mesh manipulation environment. Ideal for designing 3D models to go in virtual environments. Not awful for 3D models that are only going to a 3D printer, but fundamentally not the right tool for CAD for general manufacturing, because it cannot natively produce STEP-type geometry.
I did have some fun results getting ChatGPT to create OpenSCAD scripts. It created a fully functional parametric christmas tree for me, which I thought was kinda cool.
Simple parts, yes. Geometry and trigonometry demos? Yes. Actual computer-aided design... no not really.
I like that OpenScad integrates into FreeCad, and can do more than lousy STL outputs. It is far from perfect, but can solve some problems with ease.
Most cloud based software strips one of long-term stability in the design folder (can no longer store a version snapshot of the project binary dependencies), and so poses a liability to any firm running large infrastructures.
For one-off stuff, one could argue it doesn't matter. But in someways, FreeCad beside the project files will be viewable/exportable forever.
Unfortunately, now the Solidworks offline workflow also requires the online license nag screen every 30 days. However, it is not part of Autodesks walled garden built on internet stability (a significant issue in a remote field deployment.)
Good luck, =3
OpenSCAD was a useful stepping stone for me, from programming to 3D. But I've been doing my own designs in FreeCAD for two and a half years or so.
I just think the typical groundswell of HN support for OpenSCAD is a bit misguided; it sort of relies on near-wilfully ignoring what GUI CAD -- even FreeCAD -- can do for one's designs.
Yes, it's good for simple geometry, and some more advanced mathematical geometry. But it boxes you in pretty quickly because you cannot easily compose geometry based on the outputs of previous operations.
We actually recommended FreeCad as a core to a small medical device manufacturer looking for a custom solution to dynamically tweak their process. i.e. even a simple workbench plugin that takes a few variables to generate a simple manifold, and CAM to gcode in the same program... was a huge benefit for users now locked out of Autodesk and Solidworks walled ecosystems.
Ideal? No... Practical? You bet...
Best of luck =3
The awful limitation of OpenSCAD is that one's ability to model in it is limited by one's knowledge of math and trigonometry.
The funny thing is, when it comes down to actual manufacture, ultimately, one is making G-code, which is limited to lines and arcs in most implementations --- so I'm approaching it thus by way of Python in OpenSCAD: https://github.com/WillAdams/gcodepreview
If all you've ever used is OpenSCAD or OpenCascade-based software, you are in for a pleasant surprise.
The one 3D CAD program which I was successful with, after a fashion is the nascent Dune 3D:
which has been discussed here a bit:
https://news.ycombinator.com/item?id=40228068
It very sadly is not. Parametric CAD does not have the invariants that functional programming has. If you insert an operation in the timeline, which changes e.g. the number of faces, the CAD software can only guess to which faces the operations after it apply. In functional programming you explicitly state which elements you mean, in Parametric CAD this is done by guessing.
OpenSCAD is functional programming, it also is orders of magnitude less powerful than Fusion360.
I use the Python API to write 3D modeling scripts for everything I 3D model. It takes a little longer to build up your own utility function library so you can make models quicker, but once you've got a solid utility library of your own, making 3D models with code is really easy and fun.
A parametric CAD package starts off with some variables, makes 2D representations of them that can be solved by a constraint solver, extends those 2D representations into a third dimension parametrically, connects 2D representations to earlier generated geometry etc.
If you change an early parametric variable, it ripples through the design because the design is a directed graph (indeed, CAD designers often run into situations where they have tried to do things which would create a cycle in a graph -- use the dimensions of a subsequent part in an earlier part, which the CAD package cannot solve).
Most of the core calculations involved are functional in this regard -- for example a 2D sketch to a 3D extrusion, a 2D sketch to a sweep along a path.
The next step is assemblies and motion. Writing a solid modeling CAD engine is impressive, but kinematics and simulation is really the tough part (and why these CAD softwares are so expensive and so worth the money). For example, SolidWorks has a separate "motion study" package that you pay for on top of the solid modeling tool, a separate "fluid simulation package," to calculate stresses, drag, and so on on a part. Assemblies are also huge, most CAD programs have utilities for creating relations between different parts to figure out where screws, clasps, hinges, etc, should go where and in what order.
Many professional CAD packages also have things like mold tools, sheet metal tools, etc. that make manufacturing much much easier. You typically have a drawing tool, to create marked up drawings to send off to a machine shop for fabrication. Manufacturability is huge and mostly invisible to hobbyists who are doing 3-d prints. In general, software that makes manufacturing stuff easier, is where CAD packages capture the most value from their users. The manufacturing stuff is why you might pay $5,000 per year per seat for a CAD suite. It's also why they're not too worried about open source CAD, because the open source guys don't care, or know enough to care, how to add this type of value.
Finally, the big big boys (like CATIA and so on) have utilities to track part revisions, quality tracking, assembly and QC workflows etc. For when you need to manufacture hundreds of thousands of something, test it, have it fail in predictable ways, manage spare parts for it, be tracked and regulated etc. Those are generally used for stuff like cars and jets which have complex supply chains.
Anyways. I have solved the only problem OpenSCAD ever had. And that was -- you cannot tweak parameters just by pointing at them:
We're building this AI copilot for Fusion 360 called MechAI. Like a SWE, it enables you to store files on GitHub in JSON format with diffs, merging, etc. ;).
Beta coming out soon, check out the demos and waitlist on our website: https://www.trymechai.com/.