I'm really bullish on software driven CAD, myself and other CadHub volunteers talk regularly about a future in which Mechanical Engineering and design is very similar to software engineering.
I'll be the first person it admit that some of the current CodeCAD tools aren't production ready, OpenSCAD for example I can't imagine being used by mechanical engineers. So the idea is mostly about unifying the community with a website dedicated to this paradigm, and if we're lucky we play a small role in promoting more development and better tools in the future.
Some of the reasons it's got potential:
- 3d-diffs on pull requests [1]
- Automated FEM, CFD etc simulations akin to CI/CD [2]
- PLM managed through git
- plus git in general is such a good way for teams to work together
Howdy! Well we absolutely need more open source CAD tools.
That said as a mechanical engineer for going on two decades now, I really get no value from this kind of mechanical design. I grew up on Solidworks and now use OnShape. That kind of physical modeling is very important. Being able to click on a face and sketch some geometry and then extrude it really feels like the right modality for me. I’d really love to see more investment in that kind of parametric visual CAD.
Direct manipulation/GUI will always be faster at producing content. It worth exploring how much the two can we wedded with code synthesis. I get that code synthesis attempts normally produce poor quality code, but maybe a hybrid work flow could work between using the GUI and fixing up code.
It's a shame that the current CodeCAD tools have very little interaction with he part viewer.
Onshape is a good combination of visual + you can set exact values for things. I’m always happy to try new tools, but I tend to fallback to Blender for artsy stuff and Onshape for more precise parts.
I suck at 3d modeling, so I evaluate tools from a “how much value can a noob get” point of view.
That is definitely an important user perspective. My angle is that I am a professional robotics engineer as well as an open source evangelist. I design a lot of open source CAD and I’d really like it if the CAD package itself was open source as it is important to me to have a community of users who fork my designs. So far open source CAD does not feel adequate as a design tool for me. FreeCAD is conceptually the closest but it seems like the project needs more investment. I recently tried it again and it seems extremely simple compared to Solidworks or Onshape.
Honestly CAD is very complex software and is not well suited to a single engineer working in their hobby time. I think a huge reason Blender has been successful is that they built a sustainable crowd funding system. They currently pull in $166k each month with that system: https://fund.blender.org/
I am pleased to see also Godot engine (a similar type of tool) pulling in over $7k/month (last I checked) on Patreon.
Anyway there is a “business model” for open source projects even if they don’t sell anything. Call it a funding model. I think open source projects need to get a handle on that for anything that exceeds a very small team.
I am trying to build this kind of sustainable funding for my own open source farming robot (link in profile) and I think we’re going to go with Open Collective at least as a front end.
I think open source CAD really needs a funding plan like this. It’s a very large software project and we’ve seen how Blender and Godot are able to actually get traction and produce a compelling program with resources like that.
Maybe both would be fine, I am just saying the code part is much less useful to me than the visual/parametric editor. Onshape for example has scripts which can do things like generate gears and that is great, but I use scripts for less than 0.1% of my onshape work. The visual/parametric component is what users like me really need. I added it late to my comment but here is an example of one of my recent CAD projects.
> Howdy! Well we absolutely need more open source CAD tools.
Please, no. We need one (or two for competition) really good open source solid modeling CAD tools with parametric and other interfaces. We do not need a dozen competing tools with varying feature overlap that need to be meticulously vetted before committing to one. Not to mention wasted dev time as each tool implements similar features in different ways, wasting very limited open source dev time.
Often I feel like FreeCAD is "getting there" but it's nowhere near "there" yet.
Nah, keep reinventing the wheel for your own particular tastes and perspective. This is how open source evolves. Lots of little experiments that eventually get rolled together.
Just loaded the latest snap. I remember seeing this a few years ago. I'll have to make sense of the UI but I extruded a cylinder and it looks like the program has promise. I'm wondering if it does assemblies yet as that is key.
EDIT: I see you linked some tutorials so I will have to check those out!
My background is software, I do (mechanical) CAD just for hobby stuff, but I agree about the GUI being a convenient way of working on it.
What I desparately want though is an on-disk format that's plaintext, makes sense, and results in reasonable diffs so that I can use git for version control.
I just don't understand, being familiar with git, how people can work with 'save and mark new version' style 'version control' that's so prevalent among tools that have anything at all.
STEP files are like compiled binaries. Fine for distribution if you don't want to make changes to the file. But for a parametric CAD package like Solidworks or Onshape, much more information is saved. A parametric CAD file stores each step done to the part in order. This allows you to go back in time, change one feature, and re-apply the subsequent changes to the updated file. That's like source code to the part.
Can STEP files be parsed to order via e.g. (I know nothing about them) sorting some tree? Are there any e.g. hashes that change as content is modified?
In software we solved this with code style guides and later code formatting tools. I would be surprised if e.g. a Python script could not format the STEP files to a "canonical" representation before committing the file to version control.
From what I've seen, most programmatic integrations comes on the CAE/simulation side of the house. Faces of the part are given specific names/metadata by the designer and a script is used to automatically apply the loads/constraints and run it through the simulation.
I'm sorry but this is probably not a good idea. A typical PDM/PLM implements many things that don't exist or are not in the spirit of git, including but not limited to:
- Per-object security, lifecycle-dependent security (e.g. an object that is Work in Progress may be editable, but it becomes read-only when Released), groups and roles (per-object groups), LDAP / Active Directory integration, ITAR compliance.
- Object lifecycle (Work in Progress / Released / Obsolete etc.), driven by workflow graph that can be adjusted for the specific customer. Ability for one or more engineers to vote to accept or reject a transition from one lifecycle state to another.
- Revisioning: automatic generation of initial revision in prescribed format, automatic increment which follows the lifecycle (e.g. when transitioning from Released back to Work in Progress).
- Part numbers: automatic generation in prescribed format, alternate part numbers (e.g. when a supplier uses a different number for the same part).
- BOMs, including support for family tables.
- Custom attributes, search, "copy structure", viewable (usually PDF) generation, integration/customization API and many many other "small" details...
> So the idea is mostly about unifying the community with a website dedicated to this paradigm, and if we're lucky we play a small role in promoting more development and better tools in the future.
I'm curious what sort of market research lead to this. If Mechanical engineers are truly the target audience, I would strongly suggest that you consult with one. We already have all these things, with more features, more integrations with other tools, and more flexibility.
I've been using CadQuery [1] a lot of late to develop custom parts for 3D printing, and while it's nice to be able to write plain Python and the abstractions are somewhat more intuitive than OpenSCAD, it's still kind of brittle and complex parts are hard work.
There are things CAD-as-code excels at, but once you leave the happy path of simple primitives with a few holes and a bit of chamfer, I found things can get really ugly real quick. Organic shapes are very hard to construct, and simply generating polylines or the like either fails because OpenSCAD takes literal hours to render or because CadQuery throws some weird error halfway through and I just can't get it to work.
I'd love to see a free or at least affordable (for hobbyists) CAD solution that isn't code-only, cloud-only, totally crippled in terms of functionality, or extremely arcane. I believe Fusion 360 went cloud-only (or almost) last year or so, and between Fusion 360 and FreeCAD (which I tried to learn, but couldn't figure out) there seems to be a big opportunity for an affordable, user-friendly, open CAD tool for the 3D printer owning masses (there are dozens of us!)
I completely agree, but Fusion360 is still very usable for hobbyists in practice. It does store your files on the cloud, the software only works when it can phone the server, and Autodesk can change its conditions at any time. But for the moment, most hobbyists are happy with it.
It's quality software, and free (as in beer). It's hard to compete with that. Most hobbyists care more about making their designs rather than software ideology, myself included.
Honestly openSCAD is pretty cool but you quickly run into limitations because of it's DSL. One major reason I don't like it is that it uses mesh-based modeling and not boundary representation. With the former you can never get a "perfectly" smooth sphere for example. Most CNC shops require the latter. So a few years back I moved to CadQuery[1]. CadQuery uses boundary representation and uses Python as it's host language. This essentially makes it superior in almost every way to openSCAD.
cadquery is great! I had been a Fusion 360 user for 3D printing, but then Autodesk started getting weird with hobbyist licensing. And Fusion's insistence on being cloud-based was frustrating. Anyway, I went hunting for something else and found cadquery and haven't looked back.
Modelling via code in cadquery is definitely a different approach in a lot of ways, but it is extremely powerful too: you get all the goodies like parameter-based, non-destructive history but also things that might not be obvious up front, like being able to "comment out" sections of your model (not just hide them - but skip generating them) temporarily, building up reusable helper routines, easily swapping out rough prototype vs thoroughly designed parts that are depended upon downstream in the model, and being able to organize complex models into separate modules.
I don't think I'd necessarily recommend this approach to modelling to a non-developer, but if you're already a developer, it is tough to beat (for 3D printing at least).
Oh wow, I've never heard of this and might have to check it out. I love OpenSCAD in contrast to other free CAD programs I've tried, but not being able to directly work with STEP has been a limitation.
I really would like to know how programs like CadQuery maintain a robust geometric representation given the inevitable rounding errors that will occur in floating point. For example, how can CadQuery guarantee that a surface will never self-intersect after a number of operations have been performed on it?
Wikipedia has a page on it [1], but quickly skims over some techniques without much details.
Actually, you can get a perfectly smooth sphere both with constructive solid geometry and boundary representation. Where you cannot get a perfect sphere is mesh-based modelers.
Unfortunately CadQuery (primarily its GUI) seems like its development has fizzled out, without getting it to the point of functionality on macOS. OpenSCAD, on the other hand, works quite reliably on Mac.
Also, it's clunky, but I've had success by using Python to generate OpenSCAD code. The best application of this was an SVG to OpenSCAD path converter.
Doesn't https://github.com/CadQuery/CQ-editor work on MacOS? I don't really see how development has fizzed out. There have been quite a few commits the last couple of months.
I wanted to kick the tires on CadQuery, but I had to install and understand Anaconda first. Any tool that requires me to understand a build system or a language package manager to correctly and safely build the software before I can use it is not ready for prime time.
If this was important for my life, I might put in the effort. If it is for passing curiosity, I probably won't. Especially when it impacts not just this software but opens an entire universe of what exploits can now be run on my PC.
When I have to set up a VM to sandbox an environment for a tool, it stretches my patience. It makes the tool extremely cumbersome.
I feel you. (Un)fortunately for me CQ is important enough because OpenSCAD and similar are not CADs... they are just simple generators without an ability to reference, use already drawn things.
Whereas CadQuery has the main feature which is missing from OpenSCAD directly in its name: "Query".
I'm actively working on bringing CadQuery and all its dependencies to Nix because *Conda is an abomination of highest order.
Moreover the pywrap and OCP which are CadQuery's dependencies are even much worse. They are like galleries of every DevOps anti-pattern ever invented. The more you dive into them the more horrible it gets.
Yes I agree. Anaconda is one of the worst pieces of software on earth. In fact I have never gotten it to work with anaconda. I use this nix-flake: https://github.com/marcus7070/cq-flake which is faaaaar easier to use and setup and includes the editor. But the README says it probably won't work on non-nixos systems so your mileage may vary.
Oh no. Somebody has already created flakes for CQ :(
But also oh yeah, somebody has crated flakes for CQ! (and it seems I was only 1/2 ~ 2/3 way there anyway)
Of course, when the tool is actually a library for a particular programming language, considerations of build environment and package manager are more germane. But you still might question if it is worth it.
Since April 2021, and at the time of the OP, there had been one non-readme related commit to the linked repository. And no, CQ-editor does not work on Mac for a variety of reasons, including code signing errors.
The tool looks very nice, but the syntax, which looks pretty close to OpenSCAD, is pretty ungainly. It makes me wish lisp-style syntax were more widely accepted.
This looks incredible! Scheme syntax, ability to manipulate graphically, Scheme code updates dynamically? Very cool. I’ll have to try this for my next woodworking project.
Language-wise, OpenSCAD is very functional-ish indeed. Try writing code to distribute a vector of length multipliers evenly along some arbitrary length, e.g. [1,2,1] times 20 over 100 coordinate units. It is only possible by recursively calculating a vector of coordinate positions, in our example [0,5,25,30,70,75,95,100]. Not the easiest task for the uninitiated.
I'm not sure I understand the thing about the models not being live previews. Is OpenSCAD effectively being run on the server and the code needs to be sent to it every time you modify code or change the camera?
Honestly, that still doesn't really answer my question.
I can run OpenSCAD locally and there's never a lag like that when I pan/tilt/zoom the camera. I could understand if that lag occurs in this web app if OpenSCAD wasn't actually running in the browser but instead as an instance on a server, but the page you linked to doesn't state whether that's what's happening.
Or maybe it's just an approach to "bake" the model into an image to save resources or prevent potential freezes?
I'm not criticizing it but am just curious about the reasoning.
Quick check in the network tab shows that each camera move sends the full buffer and camera coords to some aws server where it spends a second rendering then comes back with an image.
The JSCAD integration is however all in-browser and is far smoother. They should lead with it, IMO.
I am an engineer. I do Arduino programming on the side. In my experience every attempt at a code-based CAD system has been totally useless. At every step of designing something, it feels like the scripting language is actively working against anything and everything I try to do with it. Everything feels as though it takes about ten times as long as it should. So far I've tried OpenSCAD and JSCAD.
I pirated SolidWorks last week and it is an absolute joy to use. It is like night and day compared to any scripting based CAD system out there.
CAD and code absolutely do not, and should not mix.
CAD and code absolutely do not, and should not mix.
I tend to agree, having done both programming and mechanical design. Drawing by writing code is pounding a screw.
The major CAD systems have some scripting capability, for when you need to generate a gear or a geodesic dome or something that needs procedural generation. They also have constraint solvers, so you can specify constraints and let the system find a solution that satisfies them. Try the demo version of Fusion 360 for that.
I'm an embedded software engineer and into 3D printing useful/functional things. I've made a lot of cool complicated stuff with OpenSCAD. There's a lot of problems that are solved nicely in code. For example, I made a two stage 80:1 gear box for a force feedback steering wheel project, and I fully parameterized the gearbox geometry based on the tooth count, gear metric, and extrinsic mounting constraints. As a result, I could very easily try out different ratios and metrics across the whole assembly.
It's sometimes more painful to use code for quick "all I need is a funny shaped..." projects. Some projects really benefit from having a for loop, though.
Honestly I feel like there are two types of project. The art type where you want a particular look or organic shapes and stuff like that and just hard mechanical parts that fit together. For the first code is a big no-no because you need to specify a lot of things you don't care about. But for mechanical parts that need to have specific sizes and tolerances code has been a godsend for me.
Shout out to JSCAD -- Javascript solid object CAD software. I really like it. Some things I've been able to do with JSCAD that would be hard to imagine with any other CAD software:
- From the same source files, I can generate either an "assembled" model or a "print version" arranged for 3D printing.
- Integrated into github CI/CD so that I know immediately if I broke my designs. Easy to write tests for things like bounding box size.
- Use eslint to enforce style rules. Mocha for tests. Typescript if you want.
- Browserify to bundle the design into a website. Directly from the source CAD files, without rendering to a huge mesh file format.
It's cool because you get access to the whole javascript ecosystem, and it's native to the browser.
I think this stuff is really awesome, I make turtleSpaces which lets you create and export STL models using the Logo programming language https://turtlespaces.org -- creating a shape using an algorithm and then 3D printing it is really cool!
Complete newb to the space, but I’ve been playing with SketchUp lately for some hobbyist projects, and the inability to just TELL IT what to do instead of having to drag and drop constantly has been shocking to me. Like “attach this object to this other object at this offset” or “make a rectangle of these dimensions at these starting coordinates.” So this seems very exciting.
IME, positioning in SketchUp requires fiddly d'n'd. Sizing, however, can be done by typing in numbers as soon as you start drawing a line or rectangle, start pulling a face into a volume, or any action that involves one or more offsets.
Lots of potential, but IMO not really usable for real world work.
For example, there isn't any (or I haven't found any) simple way to create a clean fillet between two complex surfaces other than blending them and hoping for the best.
Documentation of the API is lacking, except for a bunch of examples in scheme (not exactly the most popular language for CAD folks).
Python API exists, but documentation is ... reading the source code.
Finally, the implicit surface tessellation algos used in libfive are IMO somewhat unpredictable and getting them to produce precise shapes (which is something fairly desirable in mechanical engineering) is hard.
I found this [1] from MS very useful when I designed some PCB inductor coil for a project. It was only 2D, but some 100 lines of code made the development so much easier.
Programmatically generating geometry is very cool, but I don’t know of anyone doing real work with it. OpenSCAD is probably the best power-hobbyist software I know of for this purpose. AutoDesk seems to be trying this approach with DyanamoBIM, which I’m excited to experiment with (I just don’t get visual programming though).
Personally, I would never consider a web-based software for professional use. An opaque profit model makes me think you’re looting my intellectual property to resell, mining crypto with obfuscated JS or WASM, or you’re snatching up market share to get bought by Google who will just kill the service and leave me hanging.
There’s a lot of room for better software in AEC but CAD is pretty robust and very affordable at this point.
AutoDesk has supported this kind of automation from almost the very beginning (originally you had to use their Lisp variant AutoLisp but now there's more flexibility).
I agree with you about the web-based criticism though. Working in a browser feels pretty limiting and it's so slow.
I've been programmatically generating geometry in Dassault CATIA since 1998 or so. Relational Design is essentially the CAD version of object oriented programming.
I would encourage looking into Rhino3D and Grasshopper3D. As @jpgleeson mentions - this is already widely used by architects as they move from a world of buildings made up of mass-produced identical components (e.g., every brick is the same shape and size), to a world where mass customization is possible (e.g., every brick has variable shape, massing, structural properties, etc.). Being able to prescribe that programmatically has a lot of promise. Tools like Grasshopper already enable some of this customization via code as you can see here https://developer.rhino3d.com/guides/rhinopython/ghpython-ca...
Plugging into existing frameworks (like Rhino) is quite easy and can open the door to other realms of optimization/simulation for the designs you are scripting. For instance you could leverage generative design (e.g., https://www.youtube.com/watch?v=-HLRtXSG7fQ) and other software that can be used to evaluate designs according against variety of criteria ranging from structural integrity, to environmental performance, to 3d-printability, etc. If there’s open source frameworks you can plug into, even better.. and if not.. then maybe that’s what’s missing: an easy standard way for various opensource projects to share and edit information.
Programmatically-defined designs make sense to me only if you can easily change parameters to quickly produce, evaluate, and optimize the designs/variations/results. Otherwise - Better to use a GUI that allows for more direct (and less abstracted) expression of designer intent
Similarly open source CAD makes sense if it can be augmented by other open source projects - including sharing and editing data from these various projects
> Personally, I would never consider a web-based software for professional use. An opaque profit model
I worked on a web-based version of a major player in the industry and the projected ended up getting canned. Ironically, because (I think) they really couldn't figure out a good way to profit from it. A license for the desktop product was like $xx,000, but the ideas tossed around for the web-based version were like $y.00 per minute of instance time (basically like EC2 pricing). Turns out that $y would need to be Very Large to be even remotely profitable.
The product itself was pretty slick though. I was really surprised at how well it performed.
It's a little different but essentially it takes data to define geometry and machine operations. We generate that data in code and pass it on to cadcode. Cadcode then passes that on to our NC machines.
I've previously worked at 2 large engineering companies in the oil and gas space, and both were using automation to generate CAD models from configuration - not exactly the same thing, but close enough. They were doing this with both AutoCAD and SolidWorks.
> Personally, I would never consider a web-based software for professional use.
I've seen a lot of enthusiasm for OnShape (a relatively new web-based CAD tool) among professional CAD users, particularly when there's more than a handful of people working on one project.
I think the parametric constraint driven way of doing CAD is actually already pretty programmatic. While I'm not sure, I'm imaging that there might be some sort of isomorphism between CAD-style constraints and Prolog-style logic programming...
I'm really bullish on software driven CAD, myself and other CadHub volunteers talk regularly about a future in which Mechanical Engineering and design is very similar to software engineering.
I'll be the first person it admit that some of the current CodeCAD tools aren't production ready, OpenSCAD for example I can't imagine being used by mechanical engineers. So the idea is mostly about unifying the community with a website dedicated to this paradigm, and if we're lucky we play a small role in promoting more development and better tools in the future.
Some of the reasons it's got potential:
- 3d-diffs on pull requests [1]
- Automated FEM, CFD etc simulations akin to CI/CD [2]
- PLM managed through git
- plus git in general is such a good way for teams to work together
[1] https://learn.cadhub.xyz/blog/3d-diffs/
[2] https://learn.cadhub.xyz/blog/testing-code-cad/