4 ms·
Versioning FreeCAD Files with Git (2021)
- OJFord 2y agoThere's also a long-standing branch by a major contributor (but with some kind of complicated politics that someone else can probably better explain) which has a non-zipped non-churny on-disk format specifically to allow using version control. (I think it's called linkstage3, but it's been a long time, I keep trying and failing to get on with FreeCAD, always end up back using Fusion360. Not that that works well with git of course, I just can manage to actually design stuff.)
- stavros 2y agoI'm in the same boat, I always mean to switch to FreeCAD, I always fail and stay with OnShape because that's what I know, and I only use OnShape over Fusion because the former runs on Linux. I'd like to switch 5 FreeCAD just because then I can save the files to my computer, but the UI is too different from Fusion/OnShape.
- juliangmp 2y agoI've tried multiple times to get into freecad but the ux is just not for me. One time I also lost like 3 hours of work so I called it quits. Now I usually use solvespace, though that only does 3D modeling, no CAM, ...
- stavros 2y agoTo be fair, SolveSpace is tiny, capable, and pretty nifty overall. Maybe I should spend another 30 minutes to learn it again, as I forgot everything I learned the first time around, years ago.
- phkahler 2y agoSolvespace can export g-code. It's in the file menu, export 2d section or something. Select file type g-code. This is an area I'd like to improve a lot when I get back to working on it!
- juliangmp 2y agoOhh I didn't know that, thanks for letting me know. Although I won't use it because I do 3d printing and use prusa slicer.
- 0x0203 2y agoI love solvespace. It's a wonderful program. But I don't think I've ever been able to make a complete model of something I needed without running into model breaking NURBs errors. Maybe there's a list of known gotchya's that most users know to avoid in their modeling, but for me it seems to break on very trivial things so I've never been able to use solvespace as a tool. Which is sad, because otherwise, I quite like it.
- emmelaich 2y agoHave you tried zoo cad (formerly kittycad)?. It may be still too early but worth keeping your eye on. https://zoo.dev/ https://zoo.dev/
- stavros 2y agoNo, but it looks interesting, thanks! Kind of like OpenSCAD with Copilot.
- rustcleaner 2y agoI love Siemens NX 10, personally. I can't get over how it could run in Windows Server on a potato over Terminal Services a decade ago; whereas Solid Edge, SolidWorks, and Autodesk all puked and blew chunks Siemens NX 10 hummed along like the Terminal Services environment was its home turf. Maybe I should spin up a Windows qube, just for old time's sake...
- rbanffy 2y agoWouldn't it be nicer if FreeCAD had an option to save its files as a directory and optionally use .zips for export/import functions? It'd probably be much faster as well, as it wouldn't need to decompress anything during operation.
- riiii 2y agoYou also need to prohibit merge commits. I don't know the FC format. But I'm still willing to bet large sums of money that if you happen to change the same version in different ways and merge the changes that you'll wreck the file.
- Always42 2y agoI really really really tried to switch to freecad when I switched to macos maybe 8 months ago. But I couldn't stick with it. The program is just so far from solidworks for me that I cannot justify the time and frustration... The interface feels like an ee wrote it ( I am an Ee) and honestly it's buggy. I found myself restarting the program alot to get out of certain states. I wanted to like it... Mcad is the only thing I really want on my Mac I don't have a solution for.
- janice1999 2y agoSame here. I really wish there was a fork that was willing to try a new interface. Unfortunately these type of projects have complex codebases and a lot of inertia so it's unlikely to happen.
- jononor 2y agoThere is a fork calls Onseel I believe, which has a slighty different UI. And it looks like many UI improvement are coming into mainline now / over the next releases.
- jacobgkau 2y agoDo you mean Ondsel?
- jononor 2y agoYes, that is the one!
- alright2565 2y ago2 minor ui features are in Ondsel & latest git that make a huge difference: - auto-constraints. If you select a line and click "constrain", it automatically chooses a length constraint. If you select 2 lines, you get an angle constraint. A circle, a radius constraint. - constraining on drawing. When you draw a rectangle, you can immediately type one dimension, press tab, type the other dimensions. You don't need to manually select constraints.
- HPsquared 2y agoMS Office files are also a "zipped folder full of text files". I wonder if the same approach could be used on those... Could be very handy for Excel files if they diff nicely (probably not).
- westurner 2y agomartinvoz/jj: https://github.com/martinvonz/jj https://github.com/martinvonz/jj : > Working-copy-as-a-commit: Changes to files are recorded automatically as normal commits, and amended on every subsequent change. This "snapshot" design simplifies the user-facing data model (commits are the only visible object), simplifies internal algorithms, and completely subsumes features like Git's stashes or the index/staging-area.
- dotancohen 2y agoThe solution in the fine article relies on diffing what are essentially zipped text files. Thus this solution might be adaptable to LibreOffice files as well.
- cxr 2y agoPreviously: <https://news.ycombinator.com/item?id=40558094#40568509 https://news.ycombinator.com/item?id=40558094#40568509> The recommended approach in the article is not a good one, though. What you'll end up with is worse than just running unzip by hand—so just do that instead. Programmers thinking that they need Git itself (or some plugin for it) to support the file format is just a weird mental block, anyway. Unzip the files. Check in the necessary changes. It's not hard or a hard concept to grasp.
- dotancohen 2y ago> Programmers thinking that they need Git itself (or some plugin for it) to support the file format is just a weird mental block Git supporting the file format has several advantages. For one thing, changing a single word in a 37 MiB file won't add 37 MiB to the repo. For another, one could use the Git log to review the changes across commits and branches.
- evolve2k 2y agoWhat if git was just applied to the unzipped files? Might that side step some of the issues while also making say your GitHub more usable? This could be supported with a short bash script that did unzip and git commit (I’d call it unzit as the name makes me laugh). And then do builds as the last step, either storing the original zip file or having a way to zip things back up.
- lsaferite 2y agoIsn't that what using zippey as a filter is doing?
- evolve2k 2y agoMy understanding is that you git repo would include a compression optimised binary.. rather than a list of text files. A script to sort of ‘package to git’ and one to ‘unpackaged from hit’ would allow the text files to be more easily managed within git.
- jononor 2y agoI just check in my FreeCAD project files as binary blobs. For a mostly-one-person projects this works without a problem. I have never felt a need to look inside at the changes on the file format level. Opening two files/versions and comparing them visually I have don just once or twice. Frequent commits with good messages helps a lot though. Have many hundred files now, made over the last 10 years.
- edg5000 2y agoEven for a one-man project, the Git repo will get huge. At least that is what I am running into. I know one day I'll have to adress it, and probably rewrite all commits.
- ecjhdnc2025 2y agoIt’s definitely a problem, and even splitting designs up into separate files so you don’t have so many complete duplications doesn’t help that much. I would hope that better revision control options eventually arrive in core thanks to collaboration tools like Ondsel’s Lens, but the solution in this blog post might work in the meantime. Another commenter suggested FreeCAD would be better if it just worked with rich directories natively. That would be nice.
- westurner 2y agoAs text/code-based formats, e g. cadquery and the newer build123d work with text-based VCS systems like git. Is there a diff tool for FreeCAD? nbdime: https://nbdime.readthedocs.io/en/latest/#git-integration-quickstart https://nbdime.readthedocs.io/en/latest/#git-integration-qui... : > Git doesn’t handle diffing and merging notebooks very well by default, but you can configure git to use nbdime: nbdime config-git --enable --global Oh, zippey, for zip archives of text files in git: https://bitbucket.org/sippey/zippey/src/master/ https://bitbucket.org/sippey/zippey/src/master/ Are there tools to test/validate a FreeCAD model to check for regressions over a range of commits? git bisect might then be useful with FreeCAD models; https://www.git-scm.com/docs/git-bisect https://www.git-scm.com/docs/git-bisect : > This command uses a binary search algorithm to find which commit in your project’s history introduced a bug. You use it by first telling it a "bad" commit that is known to contain the bug, and a "good" commit that is known to be before the bug was introduced. Then git bisect picks a commit between those two endpoints and asks you whether the selected commit is "good" or "bad". It continues narrowing down the range until it finds the exact commit that introduced the change. FWIW, LEGO Bricktales does automated design validation as part of the game. Similarly, what CI job(s) run when commits are pushed to a Pull Request git branch?
- khimaros 2y agoyes, i built this to solve that problem: https://github.com/khimaros/freecad-build https://github.com/khimaros/freecad-build
- westurner 2y agoWhich visual differences are occluded depending on the design and CAD software parameters? If [FreeCAD] files are text-diffable, is there a way to topologically sort (with secondary insertion order) before git committing with e.g. precommit? python has a sort_keys parameter for serialization, in order to alphabetically sort sibling nodes in nested datastructures; which makes it easier to diff json documents that have different key orderings but otherwise equal content.
- ecjhdnc2025 2y ago
- s1mon 2y agoOr you could just use Onshape. There's a free plan. It runs in the cloud in a browser on desktop so it's on MacOS, Windows, Linux, and there are mobile apps for iOS, iPadOS, and Android. The versioning system is very much based on concepts from GIT, and it will let you merge changes if you want. They recently added workspace locking so that it can be even more like GitFLow (i.e. branch to do work, merge changes into main when you're happy) and the version graph shows merging more clearly than it used to.
- resource_waste 2y agoFreeCAD has a great license. You are comparing apples and oranges.
- _whiteCaps_ 2y agoI see all of these complaints about the FreeCAD interface, but I learned it without knowing any other CAD software, so it seemed fine to me. Maybe I'm just weird, I like the GIMP's UI too. Highly recommend MangoJelly's tutorials if you're interested in learning it.
- 0x0203 2y agoI'm with you. I didn't have too many issues learning it. But I also didn't know other CAD software, so I'm sure that plays a big part for people; knowing what you want to do, but not being able to find it can be very frustrating, especially when what you want to do now requires an unfamiliar workflow that looks from the outside unnecessarily complicated. So I can understand people's dislike of the software. I differ on recommending MangoJelly though; video can be good for learning CAD, but I got real tired of having to sit through a 15-40 minute video before getting to the point of what was being demonstrated. I would much prefer written tutorials or pages describing the specific feature I'm trying to use/learn. The FreeCAD wiki was more useful to me than MangoJelly's stuff and I hope people don't forget that it's there. But many folks like his approach, so do what works for you.
- imtringued 2y agoThe attachment editor in FreeCAD is just terrible. Whenever you try to attach a sketch, the first thing you have to do is rotate it into the proper orientation. There is also no visual preview of any of the operations and 99% of the action is manually entering numbers into the left pane instead of using visual tools to drag an extrusion, for example.
- compootr 2y agoGit is one of the tools that makes me absolutely love the tech industry basically every other creative field has unmatched collaboration tools to us
- jolmg 2y agoAs an aside for those not aware, OpenSCAD is CAD software where you describe the models with a programming language. Basically you have vim or some other text editor of choice in one window, write your changes and OpenSCAD detects the write and updates the preview of the model in another window. This obviously lends itself better for tracking CAD model changes in git. You can comment your code and everything. That said, depending on the model you want to make, it may be much more challenging. Adding fillets, for example, may be not trivial.
- ein0p 2y agoGPT4 by the way can generate simple OpenSCAD parts if you can describe them verbally. Even if it doesn’t get it exactly right, the result is a good starting point.
- bseidensticker 2y agoIf you use OpenSCAD I highly recommend using BOSL along with it: https://github.com/revarbat/BOSL/wiki https://github.com/revarbat/BOSL/wiki. It's essentially a standard library for OpenSCAD full of incredibly useful things. For example, adding a radius=2 fillet to a 5x5x5 cube is just: cuboid([5,5,5], fillet=2);
- ecjhdnc2025 2y agoI would suggest to anyone looking at code-CAD to look further afield than OpenSCAD, which is fun but, because it is a mesh modelling tool, quite limited. Fillets and chamfers are bespoke each time, and any kind of reflection on the structure of the resulting model is essentially impossible because it is a declarative language as well as a mesh modeller, STEP export is impossible. With anything complex you will drown in variable declarations and various bodges, and there is essentially no help for multi-body projects or assemblies. The Python/OpenCascade-based CadQuery and Build123D are bRep systems with many programmatic advantages, and because they are bRep you have generalised fillet and chamfer operations (within OpenCascade’s limitations). You also get face, wire and vertex operations on generated geometry, even some assembly support. On the JS side of things, CascadeStudio and replicad both use the emscripten cross-compilation of OpenCascade. Personally, I really like FreeCAD, and I’ve used it for complex things. But I am not going to suggest everyone should use it.
- ErikBjare 2y agoThis is why I stopped using FreeCAD and embraced OpenSCAD, which works great for my use cases.