Hacker News new | past | comments | ask | show | jobs | submit login
Versioning FreeCAD Files with Git (2021) (lambda.cx)
85 points by todsacerdoti 5 months ago | hide | past | favorite | 66 comments



There'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.)


I'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.


I'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, ...


Solvespace 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!


Ohh 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.


To 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.


I 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.


Have you tried zoo cad (formerly kittycad)?. It may be still too early but worth keeping your eye on.

https://zoo.dev/


No, but it looks interesting, thanks! Kind of like OpenSCAD with Copilot.


I 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...


You 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.


I 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.


I'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.


The 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.


I 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.


Look at MangoJelly's beginner's tutorial playlist, start on first video and follow along: https://www.youtube.com/watch?v=NXN7TOg3kj4&list=PLWuyJLVUNt...

There are definitely problems with FC (but then even expensive CADs have problems). One of the biggest problem I think was lack of good learning material. MangoJelly does an excellent work on that.


It has some issues, but I did go all in recently to prepare the drawings for a planning permission and eventually I got used to it. I was trained on Autocad, Archicad, some 3dsmax in the day. I think it is unfair to compare it to Solidworks and similar commercial software purely because of unmatched support you get out of those. Freecad is usable and not too bad IMO.


It’s worth giving the 0.22 weekly snapshots a try. The UI isn’t as refined as commercial offerings that can pay people to just do it, but the UX is much improved and quite usable. I tried to get going with FreeCAD a while back and gave up, but I’m pretty productive in it now for functional 3D prints.


Same. Make the interface exactly like Solidworks. Prioritise nothing else. And it might be a success. The interface and user experience is fricking weird. It's like Coder Art at the moment. But the frustrating thing is the core is in there somewhere beneath the stupid GUI.


It is already a success. Thousands of people are using it to make useful designs on a regular basis.


Though I will say it can be good at converting file formats sometimes. I have had a few tricky STEP files that it managed to make usable.


Last comment I promise.. https://www.freecad.org/ shows two gears that can never work together in the real world. This shows that the devs are coders first and know very little about real world design. That or maybe the intern got told to update the homepage. So much potential with FreeCad but the devs seem not able to prioritise killing the overpriced commercial SW. There are millions of $ on the table if Freecad made commercial use was a priority. Maybe they just like coding and not making money.


It is an open source project. Mostly done by volunteers. Everyone with slightly different motivations. Up until now, very few have been paid anything at all to work on it. Some funding has become available recently, for some of the developers. But it will probably never make millions of dollars. And it will never kill all the commercial SW option out there. But it can cover a larger and larger amount of hobbyist and semi-pro usecases, and I expect this trend to continue.


You don't know who was in charge of the website. The gear you are complaining about is part of the FreeCAD logo and only has artistic value. You're complaining about someone's website and lack of CAD skills, not their ability to develop CAD software.

If these people like "coding", then you would expect them to work on things like previews or visual manipulators. Lots of things to "code".


Same 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.


There 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.


2 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.


Do you mean Ondsel?


Yes, that is the one!


What is your experience level?

I made the change and I did a few decent sized projects and a major project. Obviously its no Catia/NX from a feature POV, but it can do everything I needed.


Just a casual industrial design list of things I could not do easily in FreeCAD:

- chamfer - easy wall thickness - draft angle - bosses - vents

Probably about 10 more of those operations that are easy in Fusion360 and very difficult in FreeCAD.

Great that it could do everything you needed but for many people the second you need to do adult things FreeCAD unfortunately falls apart.


I never had any issues with chamfer, wall thickness, or draft angle.

But I won't be like those linux users that pretend 'the problem doesnt exist'.

I just personally havent run into the issue. Curious, what is your experience level? I'm wondering if you are building a house of cards with CAD and not realizing it. Even solidworks will break if you do things in the wrong order.


Relative newbie. For reference, I started on openscad, pretty quickly realized that was insufficient, started learning FreeCAD before eventually arriving on fusion360. I found Fusion360 much easier to use than FreeCAD

The use case was designing injection molds for electronics enclosures. Something I would say requires subtle and precise nuances at low tolerances but not remotely a jet engine level of complex design at all.

I don’t doubt I was probably doing things “the wrong way” in FreeCAD. But it was very difficult to figure out the right way in FreeCAD oftentimes.


The Part Design wall thickness tool works but is not good.

But in 0.22-dev there is a good sketch offset/sketch frame tool that would let you make an outline wall in 2D that you can then pocket.

Another approach is to make a SubshapeBinder of a face, offset that and pocket it directly.

Fillets and chamfers work but they have OCC bugs and limitations; there are ways to work around them but whereas in Fusion360 you might place geometry on a chamfer, with anything built around OCC it is better to treat chamfers and fillets as “dress-up” only, and do them last. Anything structural is definitely better done in a sketch or with a subtractive sweep on an edge.

Bosses: you can taper pads/extrudes easily enough, and there are some tricks involving copying external geometry of sketches and face/shape binders that can help you match them up across bodies.

None of this is to suggest that FreeCAD is easier than Fusion360. It’s not, and it’s definitely something of a lifestyle choice. (You won’t hear me telling you that you should use GIMP over Photoshop, though).

But it also doesn’t have Fusion360’s limitations: ten or five projects or whatever at a time, reapplying for the license every year, STEP support that could get taken away from you again when Autodesk decides to reassess the free tier, etc.; and I can share FreeCAD as easily as I can share my designs.

Don’t get me wrong, I don’t think Fusion360 is bad or Autodesk is a particularly unusually bad actor. I just don’t want to be dependent on the whims of closed source free tiers in cloud software until I absolutely have to be.

So far, my limitations in CAD have nothing to do with FreeCAD, and my 3D printer isn’t the slowest part of the puzzle. In both cases the issue is me.

The problem of the “right way” is definitely FreeCAD’s primary issue; it’s not as easy to mix the guided flow of Part Design with the more generalised tools in the other workbenches as it should be. (Sketches on curved surfaces are a classic example of this.)

But there is an increasingly broad range of tutorial materials out there now, and the major changes around Ondsel and FreeCAD 1.0 will only improve things.


Totally get not wanting to depend on a closed source cloud provider. Glad to see FreeCAD is becoming easier to use but you did point out its most fatal flaw imo: the kernel that drives the geometry is just kinda broken right now and is buggy and crashes a lot. Good discussion here: https://news.ycombinator.com/item?id=24514191


It will always be somewhat broken; bRep has its limits, and OCC certainly does. But it’s enormously capable and open source, and all we have.

The crashes, by and large, are freecad/qt rather than OCC.

FreeCAD 0.20.2 almost never crashes; I had maybe three in eight weeks of daily struggles with a complex design problem.


Totally get that - one does not simply just wake up one day and casually write a robust, feature complete geometry kernel by themselves, as alluded to in the above linked thread. It is a massive undertaking that requires a team of very smart people and probably years of work. I do wish there was some consortium pushing for a next-gen replacement of OCC though, I would absolutely donate towards that cause. I can't claim to know whether OCC is salvageable to the point that it is possible for it to become as good as some of the closed source ones, but other, more well versed people in the space seem to indicate that it has some pretty fundamental problems with it that are not easily addressed.


There is a Chinese fork of OCC -- I'm away from the computer where it is bookmarked but I think it's called OpenGeometry? No idea if they are really making headway.


Doesn't freecad do draft angles, bosses, wall thickness and vents pretty similarly to SolidWorks?

Chamfers are a weakness, but not entirely a lost cause.


Did you try the 'part design' workbench?


check out solvespace if you havent already


I hope it changes, but my experience mirrors yours. HN loves to promote FreeCAD but when you actually sit down and use the software the comparison is laughable.


Wouldn'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.


The 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.


Previously: <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.


> 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.


What 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.


Isn't that what using zippey as a filter is doing?


My 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.


As 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-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/

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 :

> 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?


yes, i built this to solve that problem: https://github.com/khimaros/freecad-build


Which 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.


This is very interesting work; I need to dig in on it. Thank you!


Git is one of the tools that makes me absolutely love the tech industry

basically every other creative field has unmatched collaboration tools to us


As 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.


I 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.


If you use OpenSCAD I highly recommend using BOSL along with it: 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);


GPT4 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.


MS 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).


martinvoz/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.


I 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.


Even 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.


It’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.


Or 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.


FreeCAD has a great license.

You are comparing apples and oranges.


This is why I stopped using FreeCAD and embraced OpenSCAD, which works great for my use cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: