Full transcript
0:18All right.
0:20This is a version control for beginners,
0:22gentle introduction to version control
0:24for FreeCAD using the history workbench.
0:28Um,
0:29quick intro My name is Effi Blanchet.
0:32I live in the beautiful mountains here
0:34of East Tennessee. So, sure do
0:36appreciate y'all coming out here to
0:38Great State Tennessee. It's a beautiful
0:40place.
0:41And yeah, my main background is in
0:43software engineering and as of the
0:44beginning of this year I've gone full
0:46time into a startup with my father
0:49making our electric propulsion system.
0:52And
0:53we're very big both of us on privacy and
0:56open source, everything that FreeCAD
0:58stands for and um I'm happy to say that
1:00as of about 3 years ago,
1:02about 3 years ago we dropped all our
1:04commercial CAD licenses and we're all
1:06full in on FreeCAD. So,
1:08big thank you.
1:10Big thank you.
1:12So, yeah, so the first part is just
1:13going to be going through some basic
1:14concepts for those of you here or
1:17on the stream that
1:19are not developers and are new to
1:21version control or have heard about Git,
1:23they don't really know what it is.
1:25Um, and then after that we'll just go
1:27into a live demo to see how it can be
1:29used within FreeCAD
1:32and we'll go from there.
1:34Uh, so this is what I call the
1:36versioning stone age. Everybody has done
1:38this at some point. You create typically
1:41backups, different copies of stuff.
1:44You you call it, you know, bracket V1.
1:47You're going to have a bracket V1 dash
1:48final because certainly that's going to
1:50be the final one. Um, you have a final
1:52two that maybe is manufactured MFG.
1:56Right, and then you would have a dash
1:58final copy.
1:59Why that is a copy, why that's there,
2:01you don't know, but it's there, so it
2:03must be important. Right?
2:06Um and and so and so forth. So, we've
2:08all done this and to be honest, I uh
2:10still do this if there's something very,
2:11very simple, you know, you don't need
2:13anything any kind of uh crazy tooling.
2:16Um so, it's important to understand the
2:18problems with this because to be honest,
2:19before when I even when I was a I was a
2:21developer many years ago before using
2:24Git, I was also thinking like, why do I
2:25need this? No, I can just Whatever, I
2:27can FTP my code up to my server. I can I
2:30Whatever, I can I can figure it out.
2:31But, some I I feel like it's one of
2:33those things where if you've never used
2:35it, once you use it, you never want to
2:38not use it. And you want to use it for
2:40everything that's possible.
2:42So, the main problem is that poor change
2:44tracking, right? You don't know what
2:46changed, you don't know why it changed,
2:48and you don't know when it changed.
2:50Right? So,
2:51uh you may say, oh, I got my timestamps
2:53on my files, but, you know, you try to
2:55move something from one, you know, from
2:57your computer to your hard drive, and
2:58all of a sudden, all your timestamps are
3:00are gone, right? Um you can't easily
3:03compare with what's uh
3:05you can't compare the different
3:06versions. It's difficult and
3:08time-consuming to roll back to a
3:09previous one because you have to first
3:11identify what is the correct previous
3:12one and which parts are the correct ones
3:14that I have to revert to.
3:16Right? Um
3:18excessive duplication, you copy the
3:20whole folder, that takes a lot of space,
3:22especially for binary or or FreeCAD
3:24files or whatever.
3:26Uh difficulties with collaboration,
3:28right? It's even a non-starter just
3:30folders.
3:31And of course, more prone to human
3:33error, right? You start getting a lot of
3:34folders, you might say, hey, I don't
3:35need this one, I'm just going to delete
3:36it, and you know, things things kind of
3:39fall apart.
3:42Um so, version control actually solves
3:44all of those problems and more, right?
3:46It's a system that records changes to
3:48files over time, allowing you to review
3:51history, compare revisions, and restore
3:53earlier versions. You can consider it
3:56like a digital undo button
3:58>> [clears throat]
3:58>> for your entire project history, and
4:00it's a lot more powerful.
4:02And it gives ultimate peace of mind.
4:06Very, very important. For me, that's
4:08very, very important.
4:10And I would say if if there's like one
4:12reason that I say you have to do this is
4:14you need peace of mind.
4:16And besides the benefits of
4:18the solving the problems that I had
4:20already mentioned, um uh there's other
4:23things that because of how easy the
4:24tooling allows you to create versions,
4:26you naturally will create more of them,
4:29right? So, you will have more to kind of
4:31fall back to and see what has changed
4:32along the way.
4:34Uh it gives you more freedom to
4:35experiment uh more easily.
4:38Um it allows you to document your
4:40intense more clearly in the messages.
4:43Um scalability. You can start by
4:45yourself, you know, maybe you're you're
4:47you're wanting to do a startup, but you
4:49can then continue using the same tooling
4:52for once you have uh you know, a team.
4:55Um another thing AI uh it's AI AI ready.
4:59Brad mentioned on the last one where,
5:00you know, now it's you you you got to
5:02already start thinking, you know, the
5:04we're going to be having tools that let
5:07you create CAD, you know, things for you
5:09and uh
5:11uh it's a reality. It's controversial,
5:12but it's it's already starting to
5:14happen. In fact, on the last um
5:17uh developer meeting, I don't remember
5:18who said it, maybe it was Brad or John
5:20or somebody that you know, they had a
5:23use case where they just needed to go in
5:24and just like double the size of
5:26everything. So, they just go in and tell
5:27them, "Hey, just double the size. And
5:29make everything double."
5:30Right? So,
5:32but how do you make sure that it
5:35actually does the thing that you said it
5:36does, right? So, we can double the size
5:38of everything, but
5:40you probably don't want it to double
5:41your angles, right? And there's various
5:44thing How do you notice that? Like uh if
5:46if you double an angle from 4° to 8°,
5:49well, you might not
5:52notice that visually if you're just
5:53looking at something directly, right?
5:55So, you need to have the tools that
5:57tell you exactly what has changed.
6:00And uh did I mention it gives you peace
6:02of mind?
6:03Very very important.
6:05Um you know, look, we all want world
6:07peace.
6:08I know that starts with individual peace
6:10of mind here. So,
6:12use version control.
6:16Uh so, the history workbench I wrote
6:18this workbench earlier this year to to
6:20scratch my own itch in the in the hopes
6:21that uh this would be helpful for others
6:23as well. Um it is backed by Git, um but
6:27do not worry if you're not a developer.
6:29You do not have to understand it. That
6:31was one of the main things that I really
6:32wanted to to focus on is that to make
6:35something very the intuitive um and not
6:39riddled with complicated uh terminology
6:41because I've seen people just kind of
6:42step back like you know, they think Git
6:44and they think like terminal commands in
6:46the matrix and stuff like that, you
6:48know? Um so, um I intentionally made the
6:51decision to switch the terminology to
6:53something that's just regular that
6:54anybody can understand. Um but when I
6:57explain these concepts, um I will put
6:59the equivalent Git concept in blue, so
7:01you can see that.
7:03Uh and so, now we'll just uh we just
7:05just a few basic concepts for uh version
7:09control and then uh we'll just jump
7:11right into a demo after that.
7:14So, the first thing is of course the
7:15project or repository in Git uh is the
7:18complete tracked project with all your
7:20part files and the entire history of
7:22every change that has ever been made.
7:25And all of that is stored in within your
7:27directory. It's not some kind of you
7:29know, hidden thing in some database in
7:31some server. It's all just directly on
7:32your file system on your computer in a
7:35little dot Git folder, so just do not
7:37delete that. It looks like it shouldn't
7:38be there, but that's where all your
7:40history is. And you're not going to be
7:42able to understand what's in there. It's
7:44a special format, but it is
7:47in a way universal, um, and uh, so just
7:50do not delete it, please.
7:53Um, next thing, iteration or commit in
7:56Git.
7:57So,
7:58this is a permanent named safe point for
8:01your entire project at a moment in time.
8:05You can consider it kind of like your
8:06snapshot of this is my project right
8:08now. And you can make as many of these
8:10as you want, right? So, each iteration
8:12will record the changes, of course,
8:15uh, the author, if you're working on
8:16multiple, uh, with other people, it'll
8:19have the date and time and a descriptive
8:20message that explains the what and the
8:22why,
8:23um, and it'll have a unique ID for that
8:25specific, uh, iteration.
8:28And you can always return to it, no
8:30matter what happens later. Um, this is
8:33kind of a very important thing that, um,
8:35it is not possible to change your
8:37history, right? Once you create your
8:39iteration, that's it. It's set in stone.
8:42Um, there are tools, you know, if you're
8:44more, uh,
8:47uh, more experienced, there are ways to
8:49change the history, but, you know, if
8:50you're a beginner getting into this,
8:52don't even try. Um, it is error-prone
8:54because if you try and change your
8:55history and you mess something up, well,
8:56you've messed up your history, right?
8:58So, uh, the workbench does not allow you
9:00to change the history what you once
9:01you've created it.
9:03But I guess it is worth, uh, mentioning
9:05that because it is backed by Git, you
9:07can do whatever you want since it is
9:09Git, you can use other clients.
9:13All right, the next concept is the
9:14current files. Uh, that's the working
9:16tree. It's your actual files that you're
9:19This is actually your live working copy
9:21that you're working with. That's what
9:22you're familiar with already. And, uh,
9:25each file has a is is tracked, uh, by
9:28the workbench. Uh, it's either
9:30unchanged, it's modified, it's an added
9:32file, it's a deleted file,
9:34um, and the workbench compares the
9:35current files against the last iteration
9:38or if you have any reviewed files.
9:41So,
9:42uh pretty straightforward, you'll see
9:43how that looks like shortly. And what is
9:45the reviewed files?
9:47Uh there's something called a reviewed
9:49area.
9:50It's an intermediate zone where you
9:52select and prepare exactly which changes
9:55will go into your next saved iteration.
9:58Right? So, you may make a few changes.
10:01Say you're working on a feature, you uh
10:04and you say you you review them and you
10:06say, "You know what? This looks good."
10:07You click a reviewed button and it's
10:09going to go into the special area
10:10saying, "I've already reviewed this. I
10:12don't need to necessarily review this
10:14part again." Okay?
10:16And uh this enables precision. You
10:18choose exactly which files you want to
10:20be stored in the next iteration.
10:22And uh it also enables a review loop
10:25before saving each new iteration. So,
10:28kind of looks a little bit like this.
10:30So, you have your current files, you're
10:31working on them. You go into the
10:33workbench. You review everything. This
10:35looks good. You set them as uh reviewed
10:38and they go into your reviewed area. You
10:40consider this kind of like a copy. You
10:42take the current file that you have.
10:44You just make a copy of it and say,
10:46"I've reviewed this." It's exact copy.
10:47It stays there.
10:49And then from there, you can choose to
10:51continue doing some more work, right?
10:53You might add an additional little
10:55feature here and there that you're
10:56building up to.
10:58And then you review it again.
11:00And then once you're finally accumulated
11:02enough, then you save everything and
11:04say, "Hey,
11:05this is uh this is saved." And each
11:08iteration is fairly cheap uh to to
11:10store, you know,
11:12um
11:13uh
11:14doesn't take you too much space. So, you
11:16can make as many iterations as you want,
11:18really. There's no rules about that.
11:20Uh so, let's just jump into the
11:23Let's jump into the
11:25demo here.
11:28And
11:29see how all this comes together. See how
11:31this makes sense.
11:34And I'm sorry for not using dark mode.
11:35There are some people that get get angry
11:37about that, but I figured it's better
11:38for a demonstration. It's a little
11:40easier to see, I think. So, you'll have
11:41to forgive me.
11:43So, this is this model here is a coupler
11:46that goes into a diesel engine. I did
11:47not make it.
11:49A Serbian by the name of Mr. Jan made
11:51this, but this is a good just typical
11:55project of decent complexity that can
11:57warrant you know, using version control.
12:00It's got multiple part files. You know,
12:02it's typically good practice. Each part
12:04is a single file and they all come
12:06together in a single assembly.
12:08Right?
12:09So, we have a project here that we're
12:11already starting with. So,
12:13we're going to go over to the history
12:15workbench.
12:16And you'll see no project detected. We
12:18haven't actually created it. We have a
12:20bunch of files, but we have not yet
12:22started our project or the tracking yet.
12:24So, we're just going to go in and hit
12:26initialize a project or from the history
12:29toolbar,
12:31uh initialize project.
12:33And it'll choose a directory to
12:35initialize based on current open
12:37documents. So, it says it sees that we
12:39already have some open documents. So,
12:41this is the folder that I want to
12:42initialize it and that's it.
12:46So, we're in here.
12:48Now, we're going to go to the current
12:49files area. We're going to click this.
12:51And as you can see,
12:53uh we have a lot of every single file
12:55which is open here on the left.
12:58Uh we have listed here and it's all
12:59green means it's new. It's a new file
13:03um because we don't have any history for
13:05it yet, right? So,
13:08everything's green. That makes sense.
13:09Yeah, so the very first thing that we
13:11want to do if you have if you have an
13:12existing project is you want to create
13:14the first initial iteration.
13:17Right? And to do that first we're just
13:20going to say mark all our mark all
13:22reviewed.
13:25And that's going to put it all into this
13:27reviewed area, right? If we click it, uh
13:29we're just going to see the exact same
13:30thing here.
13:32And however, I uh intentionally missed
13:34one important thing, and that is
13:36whenever you're saving anything,
13:37everything has to be recomputed. All the
13:40documents have to re- be recomputed so
13:42that the, you know, the values,
13:44expressions are all evaluated properly.
13:47Um so, I'm just going to hit this button
13:48first, recompute all. It just recomputes
13:52all of the open documents.
13:54And then I'm going to refresh the
13:56project.
13:58And in this case, nothing actually came
14:00up, which is good, but something will
14:01come up later, which we'll we'll see.
14:04So now, we'll let's just uh let's start
14:06making some some some changes, right?
14:09So, the first thing is uh let's say uh
14:12we're going to go in and just, you know,
14:13maybe change the spacing of these holes.
14:18All right, so we're going to click into
14:19here.
14:20Why isn't this opening? Here we go.
14:23Let's go to the linked object.
14:31So, here we have some holes. I'm just
14:32going to change these, let's say, from
14:3430 to
14:35to 25.
14:42And uh it looks like hopefully it
14:44changed, right? So,
14:47let's go back into our assembly.
14:50Everything, we're going to recompute.
14:53And let's go to our history workbench.
14:55Let's click that refresh button.
14:59All right. So, we have some changes
15:01here. So, we can see right away that
15:04this file here is blue, it's modified.
15:06We have a sketch, and it looks like our
15:08constraint has changed.
15:11Um so, in this case, we see that one of
15:12the constraints, or two of them rather,
15:15have changed their value from .52 to
15:17.54, which actually looks a little bit
15:19weird until you realize that the angles
15:21are stored in radians, not degrees. So,
15:23actually this would be a nice feature
15:24for for me to add in here to put a
15:26little parentheses here just to put the
15:28the degree
15:29the value in degrees here.
15:31So, we can confirm that
15:33this change here actually looks looks
15:35good.
15:36And
15:37if we go into the body,
15:39we can just click the diff view to see
15:41the whole body,
15:42the 3D diff view. So,
15:45give it a needs a couple moments to
15:48essentially do a Boolean cut to figure
15:50out what uh
15:52uh what has changed.
15:54And um
15:55soon, I believe this is going to be
15:57fixed in the next release where every
16:00compute is actually going to be in the
16:01background. So, that's what Chris was
16:03talking about.
16:04Awesome.
16:06So, we can see that indeed
16:09we see uh some changes here.
16:11So, the red stuff is the material which
16:16has been uh
16:18removed, right? So, we actually shifted
16:20the holes the hole that was here shifted
16:23over in here. So, the green means the
16:24material was added.
16:26And this material was removed. So,
16:29we can go in and remove whatever things
16:32we want, just leave the added material.
16:36We can also just take a look at what did
16:39the new one look like compared to the
16:41old one
16:42right away if we want to. It's very
16:44useful.
16:47And so, we checked we we took a look at
16:49this and like, all right, this this
16:51looks good right here. So, I'm going to
16:53click that reviewed button.
16:55So, remember that reviewed essentially
16:57takes makes a copy
17:00of what we just saw
17:02and it saves it into this reviewed area.
17:05So, it it you don't see that same uh
17:10uh file here anymore. It was actually
17:13removed, not not it was deleted or
17:16anything like that, but because we made
17:18the copy and it's now in the reviewed
17:19area, it's now doing a comparison
17:22between the current file and the
17:24reviewed file. And because they're
17:26exactly the same, it's saying, "Hey,
17:27there's nothing different here, right?"
17:29Which is exactly what we want.
17:32And uh
17:34here now you'll see we actually have
17:35some differences in the assembly.
17:37And you'll see for example that uh
17:40some faces changed in the assembly.
17:43Before it was face 151, now it's 140.
17:46And we'll see some uh similar things
17:48here where actually the rotation of the
17:51joint in the assembly has changed.
17:54And the reason that is showing up is
17:56because I found out that the joint
17:58solver is currently undeterministic. So,
18:01there it sometimes, you know, you can
18:03say put a part like this,
18:05but it's also equivalent just if you
18:08rotate in a certain day
18:09in a certain way and you change the
18:11axis, it works this way as well.
18:13So, I can't It's not really fair to say
18:15it's a bug, it's not a bug, uh but it's
18:17just undeterministic. So, um I will go
18:20in and uh you know, put in a a GitHub
18:22issue to say, "Hey, maybe we can make
18:23this deterministic and therefore
18:26uh there won't be any diffs come up that
18:27will come up in the assembly workbench
18:29whenever you
18:30uh regenerate." So,
18:32uh we're not making any changes anyway
18:34to the assembly here, so we're just
18:35going to ignore that for now.
18:38Uh so,
18:42another uh useful thing is that if you
18:44make a mistake, it's very easy to
18:47restore. That's another thing that this
18:49workbench allows you to do. It allows
18:51you to restore a file that was either
18:53reviewed or uh iteration. And uh
18:57I think we can go into some some sample
18:59thing where let's go into the assembly
19:01actually.
19:02And let's say for example that
19:05uh if we hide this one,
19:08you see there's a hole and it looks like
19:09this uh the screw or this bolt is a
19:12little bit too big. So, we need to make
19:14this hole bigger.
19:16This is just another example here.
19:18So, I'm going to go into here. Actually,
19:21I forgot I have a
19:23master var set in a separate file. This
19:25is very uh
19:26kind of realistic use case. It's a
19:28common or it is a method of uh top-down
19:32design where you have one file like a
19:34spreadsheet or a var set and you can
19:35make a change in one variable and it
19:37propagates, you know, through many of
19:38the different parts.
19:40So, I have here a bolt hole diameter.
19:43All right, 19.5. And let's say, okay, we
19:45need to increase a little bit. I'm just
19:46going to make it, I don't know, 20 23.
19:50All right.
19:51I'm going to go into here, refresh.
19:54And you can see now actually that looks
19:57that looks pretty good.
19:59The whole model here looks pretty good
20:01as well.
20:02Nothing seems to have broken in terms of
20:04the assembly or anything like that.
20:06So, under normal circumstances, I would
20:09look at this and say, "Hey, you know
20:10what? This is This is good. I'm just
20:12going to go ahead and, you know, maybe
20:13I'd send it off to manufacturing or
20:15whatnot."
20:16So, I'm going to go into the history
20:17workbench first and do a quick review.
20:20All right.
20:20So, that's one of those things that even
20:22in a
20:23uh you're working on something very
20:24simple, it's the same in programming,
20:26it's the same in in
20:29uh in in CAD design and anything.
20:31You can make a very very simple change
20:34that you think, "Why do I need to review
20:35this? This is stupid. Why am I wasting
20:36time?"
20:38And it has bitten me so many times that
20:40I have actually made a rule that I make
20:42a one-line change in programming or make
20:44a tiny change in a CAD model, I have to
20:46review it because there might be
20:48something that you don't understand that
20:50happened, right?
20:52So, in our case here, we have uh
20:56a sketch
20:57or no, sorry, it was this hole that I
20:59changed here, right? So, we can see,
21:01okay, it changed from 19.5 mm and now
21:04it's 23 mm, okay? that's that's perfect.
21:08Um but there also appears to be of
21:12course we have our bar set change as
21:13well. Oops.
21:1519.5 but something else has changed here
21:18in other file here.
21:21Why did it change? 9.75 this one changed
21:24to 11.5
21:26and now I see oh
21:29well
21:31we have an expression on this constraint
21:34and this expression
21:35is also set to use this bolt hole
21:38diameter just divided by two.
21:40How did that get there?
21:42Oops.
21:44So
21:45I actually uh did not intend to do that
21:48but that is something that you look at
21:50your assembly and you would not actually
21:51recognize and in fact if I were to go in
21:53here and look at it
21:55there is actually a bit of a space here
21:57that should not be there
21:59and would have been impossible to really
22:01see that visually.
22:03So
22:04that's pretty much what visual uh sorry
22:06what version control allows you to do.
22:09Um
22:10you know, you can go in and hit your or
22:12your reviewed button say okay I want
22:15this. Actually in that case I didn't
22:16want that.
22:17Um but
22:20I can say okay that that was that was a
22:21mistake. I can go in and I can solve it.
22:24Um I can change that to be a different
22:26expression. I don't need to do that
22:27right now but I think you guys uh get
22:29the gist.
22:31So
22:32now we're in our reviewed area.
22:34Oh and I had forgot to make the commit.
22:37I am a bad demonstrator. Sorry guys. I I
22:40was I was supposed to make a first
22:41commit here. So
22:43you click this uh button save iteration.
22:46I'm going to call it initial
22:48initial uh save whatever
22:51and you can put as much stuff as you
22:52want here. A typical good practice is
22:54kind of a short first line description
22:57and then on the second paragraph you can
22:58do whatever a bunch of changes one and
23:00then two and then do as much as you'd
23:03like.
23:03Right? So, when you click okay, so we
23:06have our iteration.
23:08It's saved here on the left.
23:09And uh if you hover over the iteration,
23:12you'll see the full message that you
23:14typed there.
23:15Right?
23:16Um
23:17So,
23:18uh that's pretty much it in a nutshell.
23:21Um
23:22uh another use case is um those kind of
23:25mistakes where you know, you
23:27accidentally go in and you make a change
23:30uh that is a mistake and you didn't
23:32realize it, but you already hit control
23:34S and it's already saved. You guys know
23:37what I'm talking about. You hit save and
23:39now shoot, your last backup may have
23:41been done a while ago, right? Um
23:44So, with this, you know, if you're
23:46reviewing you have a bunch of last
23:49uh iterations, it it's super simple to
23:51go in and change things. So, I'll just
23:53do a really quick change here, for
23:54example. I'll uh
23:56uh go into this part again.
24:01And I will change the
24:03linked object. And let's just say we'll
24:05go in and change this revolution. And
24:08let's just say on purpose we're going to
24:09break something by accident. Right? That
24:12that doesn't make sense.
24:14But now we have an error. Whoops.
24:16Okay.
24:17So, I'm going to go in and I'm going to
24:18fix it.
24:19I'm going to put it back
24:22like this.
24:24And a chamfer is still broken.
24:27You know? I fig- I think I I can revert
24:29it back to exactly the way it was, but
24:31something still gets broken. I can go in
24:33and I can fix that chamfer and then
24:34maybe something else down the line is
24:35broken. So, things just get broken.
24:37Well,
24:38all right. Not a big problem.
24:41We'll just go to our
24:42We can first see the change that we have
24:44here.
24:45We can see the sketch has changed.
24:48Um so, let's just go to our last
24:50iteration and let's just go to that file
24:53eight.
24:56Click the restore button.
24:58So, this operation will overwrite the
25:00current file on disk with the selected
25:02save copy.
25:03This is the only operation um in the
25:06workbench currently that actually
25:08changes your FreeCAD files. It was very
25:11important um to design this in my
25:13opinion in a way where uh your files are
25:17never going to be touched on disk.
25:18There's nothing happening within this
25:20workbench that's going to tweak or add
25:21information about your files, about what
25:23has changed, nothing like that. So, your
25:25files are always preserved, but whenever
25:27something does change, it's very clear.
25:29Um you should see these pop-up messages
25:32like that. Um now, all of these files
25:36here currently open, they will be
25:37closed.
25:39And the reason for that is because if
25:41you have a project where you have
25:43dependencies between different files, we
25:45just want to make sure that all the
25:46links and dependencies are all updated,
25:49right? Uh and so, to do that, we just go
25:51ahead and
25:54it'll stop that.
25:55It'll close everything
25:57and uh
25:59restore that
26:01file.
26:02And then, once we go in here, we see no
26:04more errors. Everything's back the way
26:06that it was. And
26:08and that is it.
26:10So, that's it in a nutshell. I'll
26:12be happy to answer any questions if
26:14there are any.
26:20>> Do you have a model that has like a
26:21really deep history?
26:23>> Yes. Oh, do I have one?
26:24>> Yeah.
26:26>> I don't have anything that I can show
26:27right now, unfortunately. Yeah.
26:30>> You mentioned a doc getting
26:32directly
26:33>> Yes.
26:33>> Does that mean all your work is
26:35happening on your local machine, or is
26:37it actually going to a Git server?
26:40>> Uh a great question, okay. So, the
26:42question is um
26:44is does everything stay within the Git
26:46repository uh locally, or does something
26:49go out into a server? So, something's
26:52glitching here for me. I don't know if
26:53you guys see that.
26:54>> I might have a
27:01Yes, so the question is can we also just
27:04upload them to a remote Git? So,
27:06it was uh in the spirit of kind of
27:08privacy and open source, everything was
27:10designed to be local first. So, it just
27:13only creates the Git repository locally.
27:15And if we look at the project directory
27:17here,
27:18you will see this dot Git directory that
27:20I mentioned in the beginning. Um and
27:23then by the way, I'll also mention there
27:24is a dot snapshots directory that's
27:26related to how it stores the information
27:28about the files. Um so, make sure not to
27:31delete that or touch these. These are
27:32hidden files. You see the period in
27:34front of them.
27:35Um so, you might not even see them if
27:37you have hidden files files um disabled.
27:40Um
27:40but
27:41the history workbench functionality does
27:44not currently have the ability to add an
27:46external a remote
27:48uh repository. Um and that's something
27:51that could be I think actually added
27:53pretty simply.
27:54Um but collaboration features are
27:57haven't been implemented yet. So, but
27:59you're you're welcome to host the Git
28:01repository wherever you want, on GitHub
28:03or on your own server, and just uh use
28:06the command line or some other utility
28:08to to do that. Again, you can do
28:09anything you want that you would
28:11otherwise do with Git.
28:12>> Part of the advantage of using Git
28:14and a repo offsite is that
28:17my hard drive crashes.
28:19>> Exactly.
28:20The better backup a backup.
28:22>> Yeah, I got the backup.
28:24>> Yes. Uh so, actually I I think that'd be
28:26a a pretty good uh feature to add pretty
28:28soon. Um and of course, it would always
28:30remain optional. It's not like you're
28:31starting uh you're always working on a
28:34remote. Um there's definitely a good use
28:36case of especially for companies, you
28:38know, that they need a PDM or PLM
28:40software that everything's kind of
28:42centrally managed, you know. Um
28:45but also once you start going into that,
28:46there's also like how to do merges and
28:49things like that, you know.
28:51Um
28:51Uh maybe someday.
28:54Someday. Yes.
28:55>> I'm a little confused at what level this
28:57is working at. Like a normal
29:01FreeCAD file is not asking
29:03you how big it is.
29:05>> Yeah, so the question is how on what
29:07level is it is it generating the diffs?
29:10Is that
29:10>> You showed the
29:12the um
29:13file there where the whole
29:15thing was like a normal diff.
29:17But like that that detail is not
29:19>> Yes.
29:20>> How did you get that detail there?
29:22>> Yeah, so uh yeah, the question is how
29:23the level of detail was created here. Um
29:26And the answer is that um technically um
29:31all of the actual
29:33uh
29:35uh properties are actually stored in in
29:38the FreeCAD file called the the
29:40document.xml. So there is an XML file
29:42that has this information, but I opted
29:45not to use that um for a couple of
29:48different reasons.
29:49Um one of which is that unfortunately
29:52that file does not allow you to have uh
29:55a full
29:57tree representation. There's no way to
29:59recreate this tree that uh for me was
30:01one of the uh a top priorities uh
30:04because I'm looking at my tree all day
30:07and I want to be able to see the diffs
30:09the way I'm used to seeing them. Right?
30:12Now underneath the hood on a low level,
30:14there actually is no tree. It's just
30:16there is just references between
30:18different object. Everything is just one
30:19level. So I said, "You know what? I want
30:21to have a tree." So I have to create
30:22some sort of separate file that stores
30:25uh the state of a particular FreeCAD uh
30:29uh file, right? So I did that.
30:32>> So you're writing inside the working
30:33writing an external file and then it's
30:36the
30:36>> You're right. Right. So on the low
30:38level, it actually generates a YAML file
30:40and you can even use this in diff them
30:42in an in another, you know, text diff uh
30:45uh
30:45uh
30:46manner. And And you'll see what it is
30:48there, but it is essentially a YAML file
30:50with all the current properties and
30:52everything that's there, but it also
30:53stores the state of the tree.
30:55Um and another minor thing, but also a
30:58kind of a a nice nice to have is that
30:59these properties are grouped the way
31:02that you're used to seeing them grouped,
31:04right? So, it's especially pertinent if
31:06you look at uh
31:08uh just whatever, just like a like say a
31:10sketch, right? You have an attachment,
31:11you have a base, internal geometry
31:13sketch, and uh so, I extracted that, and
31:16I'm just It's like storing metadata,
31:17essentially, and that is committed along
31:20with the
31:21um
31:22uh committed along with the uh your your
31:25iteration, right?
31:27Um
31:29uh
31:29In a way, I was also kind of hoping that
31:31wouldn't come up because I actually want
31:32to change that. It might change a little
31:34bit cuz I think a better design would
31:37actually be to just rely on the document
31:39that actually XML as the source of truth
31:41only and go to it every single time.
31:44And then just to only have the
31:46GUI-related stuff for the tree stored
31:48separately unless
31:51uh we are able to get that
31:54like put that into the actual like GUI
31:56document.xml, which is there, in which
31:58case I have all the information I need
31:59without having to store anything
32:01separate. And in fact, there is a
32:02discussion going on right now with Peter
32:05How do I pronounce the last name?
32:06Peter Hima,
32:08uh where he was also working on some
32:10kind of diff project.
32:12And uh he saw my project uh this
32:14workbench, and he said, "You know what?
32:17Uh maybe we can even make a way to
32:19expose the some of the functionality
32:21that you need so that you don't have to
32:23kind of maintain it yourself in this
32:24workbench." And of course, there's a lot
32:26of other work
32:27workbenches like uh
32:29Onshape Lens and other things that could
32:31make use of of uh diffing or whatever
32:33functionality, right? Uh so, it it seems
32:36that he thought it made sense. So it
32:38maybe they'll uh uh eventually the
32:40developers will expose, you know, the
32:43tree actual tree uh and other things
32:45property groups and then it'll be uh
32:47there'll be no need to store anything
32:49else.
32:51>> Yes.
33:14>> Well, when you uh oh, so the question is
33:16like what happens if you're uh revert or
33:20restore a file from the from the
33:23previous iteration and then you go and
33:25uh it creates a
33:27some kind of a conflict perhaps with
33:28other files? Is that
33:31>> if I added
33:33um added it and arm and whatever and
33:36then I
33:36had it come back in my hand just like
33:38this so.
33:39But then I removed the base that it was
33:41on later on.
33:42>> Okay.
33:42>> And then I tried to remove that arm
33:44feature from that point in the history.
33:46Like it's I see.
33:49Right.
33:52Yes. Yes.
33:54Yes. Uh so uh basically when it comes to
33:58reverting features, that is not
34:00supported. You cannot revert a feature.
34:02It's the whole file or nothing else. So
34:07uh
34:08on the file level is I think it's really
34:10the only realistic way to do it unless
34:11Chris somebody smarter than me can
34:13Yeah, he's like Chris is like no no way
34:15no way.
34:16>> [laughter]
34:22>> Oh, it would be a lot of it'd be a lot
34:24of work to do like merge kind of thing.
34:25Now, there is an I know there is another
34:27CAD software that does it so I know that
34:29it is possible. Um but uh, yeah, that's
34:32a whole different ball game. And
34:34>> Okay, just normal like over arch areas
34:36are like analogous to the top level of
34:38any problem.
34:39>> Yeah.
34:40>> Like if you're changing the architecture
34:42of the file too much, then
34:43>> Yeah.
34:44>> all of it changes differently.
34:45>> Yeah, on the other hand, you know, uh,
34:48history, we we're kind of used to doing
34:50things where you have to go back and you
34:51change history and sometimes it just
34:53breaks. You have to take care of it,
34:55right?
34:55So, I I do see maybe a way where you can
34:57just kind of take some a new feature or
35:00something and that is missing in the or
35:03new in the other one
35:04uh, and stick it in there and maybe it
35:06doesn't break anything.
35:08Or maybe it does and you have to fix it,
35:10but either way you were able to kind of
35:11merge that in.
35:12So, maybe there's a way. Yeah.
35:15>> Does the workbench work that way?
35:17>> Uh, so, I've tested this on sketchering
35:20sketcher, uh, part design, part,
35:24and tech draw.
35:26Um, I did not test this with cam
35:28workbench or other workbench, but in
35:30theory everything should work. Um, there
35:33might be certain things which are not
35:35very useful, perhaps to look at. Like
35:37for example, when I was working on,
35:41um,
35:43on tech draw,
35:44I kept getting changes every single time
35:46related to some kind of a cache
35:48template. There was a cached,
35:50uh, thing that was constantly being
35:51changed. So, there's actually actually
35:54kind of brings in a a good extra little
35:56thing to add here is that if you go into
35:58the settings of the history workbench,
36:00you can actually choose which properties
36:03or objects you want to exclude. So, if
36:05something is like not helpful or it's
36:07it's just
36:09it's useless, right? You can just go
36:10ahead and add that particular object
36:12into this list and it won't show up in
36:14the diff anymore, right? Um, so, it is
36:16kind of made so that kind of to be
36:18generic so you can use this with
36:19hopefully any any kind of workbench. Um,
36:23and it you can also note that if you
36:25hover over any particular object, it'll
36:27show you the name of the internal uh,
36:30object type. So, you'll see that this
36:32one is a part design pad. So, if I were
36:34insane, I would just go in and add that
36:36to the list.
36:41Yeah.
36:42>> Online code
36:44has very visual shape oriented. It'd be
36:46very cool
36:49You could attach a thumbnail on the user
36:51browser history by looking at the
36:53shapes.
36:54>> Yes.
36:55>> Yes.
36:55>> Yeah, so
36:59Yeah, so
37:00the question is about thumbnails, maybe
37:02to be able to include that. I actually
37:04had that
37:05feature request before, but I think
37:08FreeCAD already includes a thumbnail or
37:11optionally in the settings you can
37:12include a thumbnail. So, it would just
37:13be a matter of extracting it, right? So,
37:16I think that could be done very easily,
37:18actually. Yeah.
37:18>> And you may want to make it optional.
37:20The user could include it in the diff.
37:22As a as a thumbnail for the commit.
37:25Like your your red green, so you can see
37:26what changed.
37:28>> Are you talking about within this view
37:30that we see here?
37:31>> Well, when you make a commit message
37:34>> Oh.
37:35>> I attached an an image to it. So, I'm
37:38I'm browsing through the commit history,
37:40I can see, "Oh, this is the one that
37:42moved the holes."
37:43>> That's a great idea. Yeah, to be able to
37:45attach a thumbnail to the actual commit
37:48so that you when you're in your
37:49iteration list here
37:51there'll be a little
37:52a little icon there.
37:54Yeah, that's great idea.
37:57>> One last comment on the red green.
37:59Was that your choice of highlight
38:01colors?
38:01>> Yes.
38:03>> Let me mention that all the men lose red
38:06green color distinction as they get
38:08older.
38:09>> I see.
38:10>> I found that out cuz my first
38:11presentation to our boss's boss, red
38:14green they couldn't see the difference.
38:16>> Mhm. I see. Okay, so
38:19switch from blue green to something that
38:20is more
38:22accessible.
38:23>> I think pink is good.
38:25What's that?
38:28Yeah.
38:28>> [laughter]
38:34[laughter]
38:36>> Right. Right.
38:38Yeah.
39:09So the question is does every iteration
39:12that you save does it copy the existing
39:13files as they are?
39:15Git has it's own way of storing
39:19just the differences that are part of
39:21every file. It does not store the whole
39:23copy so it's actually more efficient
39:25than copying the whole file. However,
39:27there's a caveat which is that by
39:29default FreeCAD has compression enabled
39:32which means that every file is a binary
39:34file technically. So if you go in and
39:38change one tiny little thing or even
39:40just press control save and the
39:42time stamp changes, the whole file is
39:43different which makes it not efficient
39:46in terms of storage.
39:48But if you go into edit preferences and
39:51you go to document
39:53you can go to this document compression
39:55level and you can set that to zero.
39:57That's kind of a little trick that I saw
39:59online that a number of people are using
40:01where you set the compression to zero
40:03and because so much of the source
40:05isn't as XML based, not all of it, but
40:08it's XML based
40:10not everything is going to change within
40:12that file. So so it's only going to
40:15change the
40:17uh only going to store kind of the
40:18differences between the last files,
40:20right?
40:22And the snapshot that you saw, the YAML
40:24file,
40:25uh will also just change within there.
40:28So, it's not going to change the whole
40:29the whole file. It's not going to like
40:31store the whole copy. And Git has its
40:32own uh internal mechanisms of saying,
40:35"Just give me the whole file as it was
40:38at this particular iteration." And it
40:39can re- recreate that whole file. And
40:41that's exactly what happens when we hit
40:43that restore button.
40:44It just says I just, you know, say,
40:46"Git, please give me that file." I say,
40:47"Thank you, and now put it here.
40:49Overwrite that file, right?" And that's
40:51it.
40:52>> But that only works with the compression
40:54on the finished file set to zero.
40:57>> Uh it'll always work. You can use this
40:59workbench without that setting. Setting
41:01the the compression level to zero is
41:03simply saves some disk disk space, so
41:06that it doesn't have to copy the whole
41:07file every single time you create an
41:09iteration.
41:10If that makes sense. It's just a a disk
41:12saving thing.
41:13>> So, it's a trade-off on saving you're
41:15taking up more disk space at that rate
41:18>> Yes.
41:19>> for just the most recent file.
41:22>> Yes.
41:23>> disk space in the total um your recent
41:26file plus your previous iterations.
41:28>> Exactly. So, you uh will use a little
41:31bit more disk space for each file the
41:33first time around or for your current
41:34files list for your just active
41:35directory. Uh and then after that,
41:38they'll they will take some less space.
41:40Um
41:40and you know, there are some projects
41:42out there that I noticed that they're
41:43they're trying to uh save on space.
41:46Um there's one called like Git SCM or or
41:49or something like that. I I forgot the
41:51name of it. Uh that does some kind of
41:53kung fu in the back to empty the whole
41:55FCStd file, and then just store them
41:58separately somewhere, uh and kind of
42:01kind of save on space. Um it it's just a
42:04matter of personal preference.
42:05Personally for me, I don't really care
42:07that much about space. So, I would
42:09prefer just not to touch the FreeCAD
42:11file and just, you know, let the
42:13developers deal with it. Chris, that's
42:15on you. Brad, that's on you, right? You
42:16guys take care of that. And I don't want
42:18to mess with it.
42:21And like
42:23you know,
42:23this is disk is is been getting so cheap
42:26over the years you can get a, you know,
42:28terabyte or two for nothing these days.
42:29So I I don't even think about it too
42:31much.
42:34Yeah. But uh yeah, that's just personal
42:36preference.
42:43All right. Thank you.
42:46>> [applause]
42:50>> Have you
42:51had any contact with the Opulo folks?
42:54>> I don't know who that is. Opulo?
42:55>> Opulo.
42:57They make a an open source
42:59pick and place software.
43:01>> A what machine?
43:02>> Pick and place or making circuit boards.
43:04>> Oh.
43:05>> Um
43:06partial
43:07the
43:08Stephen Harris You know who that
43:11He started the company there.
43:13They never really got it
43:15FreeCAD plus a Git-based
43:18version control thing. Part of it
43:20anybody I've ever seen.
43:21They actually have a client side
43:22learning system. It's not really
43:24practical.
43:26Because of the way that the lines are
43:27tied together.
43:29It doesn't make any sense. If you write
43:30something that's not there.
43:32>> All right. Uh I've been asked by a
43:34couple of people to make sure that I
43:35highlight the fact that our meetings are
43:36open. Um there's a there's a calendar
43:39out there. freecad.org/events
43:42We're doing all of these maintainer
43:43meetings that that Brad mentioned. You
43:45don't have to be a maintainer to show up
43:47at those meetings. Anybody can show up
43:48at those meetings. We certainly
43:50encourage developers to show up at them.
43:52So freecad.org/events is going to show
43:54you our meetings calendar. It's going to
43:56show it in your time zone. So it's
43:57showing me the times right now um just
43:59in US Eastern time zone. But I should
44:01call your attention to the fact that Fe
44:03uh his work on the the history
44:05workbench, it's an add-on. Uh and we
44:07have hundreds of add-ons to FreeCAD and
44:10there is a bi-weekly add-on developers
44:12meet up that dedicated specifically to
44:14add-on developers. It's run by
44:17Frank Emmer Sarco or how however many
44:20letters he has in that GitHub handle.
44:23Anyway, Frank Frank [laughter]
44:25runs that that meeting. And so that's
44:28this what's showing up here as 10:00
44:30a.m. on It's every other Tuesday, I
44:32think. But as you can see there's a cam
44:34meet up every week. If you're one of
44:36those crazies, we have an open cascade
44:39meeting and that is with Dimitri, the
44:41open cascade developer. And again, open
44:43to anybody who wants to. We have our
44:45bi-weekly or twice monthly, I should
44:48say. So our twice monthly developers
44:50meetings. That's not specific to any
44:52particular like we're not trying to
44:53merge PRs or anything like that. That is
44:55just a an abstract development question.
44:57Anybody who wants to can get themselves
44:59on the agenda there. So
45:01we we really try to do as much of our
45:03development as possible completely out
45:05in the open.
45:06Make sure that we're having a
45:07conversation with each other. It's
45:09supposed to be a community project with
45:10community input. And community is
45:13everybody. It's users, it's developers,
45:15it's translators. It's So anybody who is
45:17interested in the project is welcome to
45:19show up at these things and and have
45:21something to say.
45:28Sorry, Billy.
45:30Great.
46:14>> Mhm.