All right. Good morning. Welcome back to the open hardware and CAD-CAM Devroom. It
falls down to 26. Our next speaker is Lucas, the author of the Doom 3D Mechanical
CAD package.
So, hi everyone. Thanks for the intro. Today I'm going to talk about my 3D CAD
package, doing 3D. So, first of all, a quick intro about me. There's a third of
course. So, I didn't start writing heads-off there because I thought like it. It came
out of a personal lead. Need like it with many open source projects. So, my real hobby
is writing heads-off with my real hobby is like doing other projects like shown here. And
like they are pretty much these days converged on PCB in a 3D plastic shell. And one thing
that getting Bob's made and 3D printing have been common, that they pretty much require you
to use CAD. When making things out of wood or metal with machining or so, CAD is somewhat
optional. So, if you need a whole somewhere, you could just take out the drill or the
hole that you're done. But if you're making a board made, everything that has to be on the
board has to be in the CAD. And with the same drill, you can file things off or so, but
it will it won't look nice. So, basically with 3D printing, you're effectively trading
your handyworks skills for CAD skills. So, CAD is really important to do of those. So, a couple
of years ago, I wasn't quite satisfied with the site of a state of Kai CAD back then.
So, I started developing Horizon EDA, which fixed the CAD problem in the electrical rod
for me. And, but then there was still the issue of the mechanical world. I said all of
these projects require some 2D exposure of some sort, and I found myself oscillating between
3K and whole space. Like, either of them, like, had their ups and downs, but for some projects
I used 3K, for some projects I was also based, but wasn't quite satisfied with either
of them. So, they mixed in why exactly that was. So, 3K that, like, some important things
right, that is mostly that important export, that is the important importance to import
the PCB from Horizon EDA, and export being there. So, you can have, like, an accurate
export that isn't just a triangle mesh like STL.
And, for instance, our importance to make the part look nice in an easy way without having
to manually do hacky things with sketches to get the edges tempered or fillet it. But,
what didn't work out nice in 3K was the referencing due to, like, the topological
naming things, and the sketch of being model, always made things a bit irritating to
use. And, also, what's other, didn't quite like is that you can't, don't really have
constraints in 3D, so if you want to extrude something, well, you can either say it's
up to a phase or up to certain lengths, but then that's it. On the other hand, salt space,
was pretty much job with it. It didn't have that import, it had that export, but that
was a bit janky. So, that import, I somehow worked around importing the PCB as an STL,
but yeah, that made it all of a feature this blob with no real way of referencing it.
And, it also didn't have time for the fillets, but it showed me that, like, CAD could
be, like, easy and fun. Like, referencing, you could just reference everything throughout
your model, and it just worked without any issues with topological naming. And, it also
had, doesn't have, like, a separate sketch of work bench, you can just draw and work
paint all in 3D and it'll work. And, also, constraints in salt space, they apply in both
2D and 3D, so you can use constraints to do basically everything. So, don't have
thought, well, wouldn't it be nice if there was something that could, like, take all
of the boxes? So, well, I thought, then I thought, well, I managed to pull off if the
lot of thing horizon EDA as a PCB CAD software and it worked out pretty well for me, so
could I pull off the same thing for 3D CAD package? So, how does one develop a 3D CAD application?
So, step one, make a PCB CAD application. And, then, realize that you'll have the way
there, the Ling3D CAD application is a trans-out, like, there's some similarities between
the two. One of them, being the 3D view, that means that, like, horizon EDA has a 3D
preview that you just open GL to render the board and you can rotate it, but you can't really
manipulate it in any way, but still. And, you know, how to, like, use OpenGL, import step,
render it, and basically, you know, like, how to make, how to make things render in 3D.
And, yeah, the importing step part, and all the exporting step, was managed by OpenCastate.
So, like, that's the, to my best most, the only real game in town, if you want to deal
with step in a playable way. For example, for exporting the PCB, I construct the wires
that make up the outline, and then extrude them by the 15th of the board. So, well, that's
already the cooperation of any 3D CAD making solid, so I thought, well, that's already there.
The only part that was then missing in the building blocks was a solver, since, like, horizon
EDA, like with many other PCB tools, you move things, and then this day where they are,
but that's not the way people commonly use a 3D CAD, that they want to use constraints,
that define the relationship between entities, and then these done result in equations
that get solved by the solver. And, luckily, the solder part of the solver space is available
as a library. So, the library, the library back where it's held, isn't quite useful for any
serious work. So, ended up basically ignoring that, and directly using this solver put into
the solver space and submitting my own equations to it. So, it's all over, it's a bit weird
in some places in a way it's written, but it works reasonably well, and it's easy to integrate
into any, any other project. So, that's basically how Unity came to be. It's the use interface
and basically overall design of a rise in EDA, with, let's say, the dormitory corner from
freecat open cascade, and it's all over, and workflow from solfspace. So, as some people describe
a Unity as, like, a spiritual successor to solfspace, since it works for pretty much the same.
Yeah, and it's, like, still different from full space in the way that it uses open cascade
as a geometry corner. So, some quick facts about Unity. It's written in C++20, and it's about
50,000 lines of code, when it initially released about two years back, it was 32K lines
of code. So, it obviously grew a bit, but not beyond any bounds. The user interface is written
in GTK MM4. So, back, when I started the project, I had a choice, well, through the
still continue using GTK3, like I did with rise in EDA, or should I pick GTK4. Then,
well, technically, there's nothing that I'm missing from GTK3, so I could have very well
used GTK3 onwards. Well, as we've toolkited, like, they evolved over time, and at some
point in time, they're, like, obsolete. So, as mostly went with GTK4, to have a longer time
until it eventually gets obsolete. And, like, from the developers point of view, I wouldn't
say that it's, like, significantly better than GTK3. There were even some features, like,
menus, where GTK4 made things, substantially harder than they were in GTK3. The data format is
just JSON. Like, it is in a Horizon EDA, since that makes, like, writing out the internal
object representation quite easy, and it's also easy to inspect and manipulate with other tools
if strictly needed. And, also, as same as Horizon EDA, it internally uses UIDs for everything.
And, like, about two and a half years after the initial, like, alpha error, alpha,
like, not the least, after I pushed it first to GitHub, I estimated it's got about, like,
more than 10, but less than 100 users. And, I think, like, that's what I'm quite happy with,
like, if it were, like, many more users, and just me as a developer, it will get
overwhelming with issues and back reports, and whatnot. Like, right now, it's in a pretty good shape.
There are, like, people, like, many of my friends are using it, all the people that I don't
know personally are using it. And, it's very, very important, as a community that has
formed around it. So, and, we've had five releases now, with the latest release, being version
1.4, that I released early this week. Yeah, it has some new features and many and thousands
of tons of bug fixes. The most important features being the FX port. And, some enhancements to
the array groups that are a bit like completed to explain. So, best we did documentation on that.
So, let's now go into the main part of the presentation. So, what's changed since version 1.0,
that I gave you to talk about two years back. So, like, the main purpose of any cats-off
fair is making solid objects. So, initially, in version 1.0, the only way of making solid objects,
either extrusion or lates, with lates being, you take, like, outline and we take it around the line.
And, then, gets, like, a shape, like, you would make it on a lathe. And, later on, we got a revolve,
which is basically, like, lathe, but not over a full circle, but over just an arc with an angle that
can be constrained. And, then, also, loft, which is something that force-based didn't support.
Since it can be quite challenging to them incorrectly in the 3D space. Since what it does,
it takes two or more sketches and generate the solid by interpolating between them.
And, so, in June for the, you just make multiple sketches and multiple work planes.
And, then, at a loft group. And, then, that basically just takes everything, like,
just takes the old geometry in these groups and submits them to open cat cage to make this
solid out of it. So, the pipe groups are a bit like the extrude group. Like, in the extrude group,
you just interpolate along a linear path. But, in the pipe group, you can specify the path
arbitrarily by means of lines, circle segments or arcs or basic curves. And, you can then make
arbitrary shapes like that thing that looks a bit like a long either.
And, all of these were enabled by open cascade. Since, yeah, all I had to do is take my take the
entities from June 3D and convert them to something that open cascades understand, which is basically
the same logic for any for any solid group. And, then, just take open cascade, well, now,
make it solid out of it. So, I really can't overstate, like, how important open cascade is
to do in 3D since, like, that part is the really hard stuff in 3D cat and open cascade does it
all for me. And, that was, like, one of the things why I started doing 3D since, like,
whole space is pretty much, like, the sum of that, but since it has its own geometry kernel,
it could really tap into the power of open cascade. So, I thought, well, how about making,
like, a whole space, like, thing with open cascade, yeah, that's how it really came to be.
So, next to making solids, another important part is constraining. So, and then constraining is
something that you do all the time when working on a model, the workflow is quite important there.
So, initially, when you place distance distance constraint, you select to constrain distance,
and you then you got just the constraint distance line sitting directly on the object that you
were concentrating, and then that was, so manually had to grab the thing, move it where you wanted
to be, then double clickers to enter the value. Yes, since these are pretty much the steps that you always
do, it's now integrated, so you select constrain distance. Then, afterwards, you still have the
constrain, you put your mouse, then you place it, and then you get the pop up for entering the distance.
And in addition to that, there's now a live preview. So, if you look at the top screen shot,
there you see the menu is slightly transparent. So, as you hover over these constraints,
with a live preview of what a constraint will do to your document. So, no one may ask well,
that's a pretty obvious thing to do to make that thing do all of these steps at once,
but yeah, initially developing VIN3D, I just wanted to get anything done. So, at least,
so as soon as it was functional, I thought, well, it's good enough for like the initial release,
and then I can go on like working on something else that was more important than like getting the
workflow part right. Another part that also goes a bit in workflow direction is the constraint menu.
So, in some cases, there's only one constraint that applies, but still you have to open the menu
and select the constraint from there, or type in the key sequence to use that constraint.
So, to make that easier, there's now the constraint menu that can be opened by pressing the Z key,
and if there's only one constraint, the menu doesn't open, and you just get that constraint applied.
And the menu also got a result of an update recently in the way that it has that in 3Ds thing there,
since doing 3D supports constraints both in workflow and in 3D, they can apply leader of them.
In a way that was selected before, by like unseeking the work plane, checkbox,
a very button of the viewport, it can be a bit hard to find. So, now there's that in 3D in the menu,
so you can select right away if a constraint should apply in 3D or in the work plane.
Another thing that pretty much every other cat package with constraint supports are measurements.
So, in those places, they were called reference dimensions, new 3D they're called measurements,
and what they do is they basically like a constraint with a datum,
and what they do instead is they don't apply constraint, they just measure the distance angle also.
Apart from these enhancements to the core functionality, there are also some UI enhancements,
where a lot of them actually, so let's start with one of the other.
So, when deleting things in flow space, you got the popup that says, well, if you deleted,
let's say an entity in the first group, and that, but entity was referenced by constraint,
you got the popup that, well, that constraint also got deleted,
since it was referenced by since reference and entity that's no gun,
and that thing can also happen in other ways, like you will delete some entity and the whole group is appears,
since the group was relying on that, for example, work plane to define the plane that it operates in.
So, in flow space, there was that model popup that you had to like explicitly dismiss,
in Unity, it's somewhat similar, but without the annoyance of the popup being model,
instead you get that toast message appearing at the bottom of the viewport,
and with a nodule here, it has a timeout, so when you don't interact with it for like five seconds or so,
it goes away automatically and provides, so it's, you can just ignore it if you don't want it.
Another thing that you do quite often is basically all the time, it's selecting things.
So initially, it just selected whatever was visible on top, since the section used for the works
the way that it basically renders to a second invisible buffer, and just instead of rendering things in
colors, it renders things by the object ID, and then it just looks at that buffer and
sees like what pixel values in there and then translate that back to which object it is.
So to like give make it possible to select things that are underneath the current thing,
it does something that I call selection peeling with a similar to the rendering technique that's peeling,
so it first renders something and then when you click on it, then it renders everything,
but the thing that was selected and then does the thing up to eight times, so you get the menu
of all the things that are underneath what your current thing is clicking on. Sounds a bit blank,
but works well. So another thing, right to section is the section filter you can just select
if you want only one entities or constraints or just things in the current group.
Yeah, and also going in the way in the way of selection, so if you have a complex
document, it sometimes may not be quite easy to tell like what you're actually looking at,
that's why there are tool tips that appear when you hover over things in document,
and it tells you what you're looking at, and which work pain there in and so forth.
And also think that makes that easier in complex document as body colors, initially everything
was just like solid gray, and now you can assign individual colors to individual bodies
to make it easier to tell a part. And last but not least, here's a contribution by like someone
who wasn't me, and unfortunately for what the name right now, what they added is the thing that
also wanted to add for quite some time, so I'm really thankful for that contribution,
what it is, it's basically the same thing that you have in frequent or other cat packages,
it's a cube that you can click on to align the view to the side of the cube. Before that,
it was just like a lowly pop style thing was just an indicating which way each access goes.
So, and apart from like UI enhancement, there are all the new entities, since version one
patio, the most notable of them being basic curves, initially it only supported arcs and lines,
and it was a bit hesitant to add bigger curves instead, I didn't quite understand the most behind them
back then, but after after watching some videos, by especially if I had called me around that,
I really started to like fancy implementing this year, and they're well there we are.
They're actually in some ways easier to deal with than the arcs, and adding basic curves,
enable the whole lot of other features, one of them being curvature curves, curvature curves are
a tool that basically indicates how much a line is covering, so it's basically the inverse of the
arc radius, and it's commonly used to ensure continuous curvature, so you have edges or corners,
where things don't just transition from like a set line to arc, and that you can use
basis to smooth a transition and they object nicer to look at. What goes in the same way is to
constraints for saying curvature, these were like mathematically quite challenging to get them
right, since if you don't get them right, you'll just end up with something that isn't
continuous in curvature, and it's quite hard to debug, but eventually I got it right,
now they're constraints to constraint, curvature to be continuous between
either two basis or an arc and then the basic curves. Another thing that was enabled by
basic curves was text entities with full support for open-type text. The way that works is
the text is rendered using the typical text, text rendering stack consisting of half-glass
and free-type, half-glass is the important part here, simply just using free-type, you just
basically have to do the translation of a character of codepoint to clear yourself,
you don't get nice things like shown here like, um, ligatures or support of open-type figures,
but since I'm using a half-glass for the purpose, you get all of the nice type-setting things like
ligatures, uh, curling, and open-type features features basically for free, which so as far as I can tell
is quite unique among text support and cat packages. So while it's quite nice that you can
draw basic curves and so on yourself, you can also import them, and for import there's the XFM
port which initially added for the different could import a logo for a project they were
working on, and when with the XF order done SVG, since I already had experience with the XFM port
from Horizon DA and DXF is a bit simpler than SVG for that. A thing is if you import a logo
that's quite complex for example, like the UV logo here, we end up with a bunch of entities that
are at best constrained to be a coincidence at the end point, but you still have lots of free-to-free
them that will dramatically slow down the solver, even though you're not really wanting to
solve that in any way. So to fix that, there are these things called cluster entities,
they're not called groups, since groups are already different concept in human 3D,
so they're called cluster, so that's basically a summoning for that, and what they do is they take
multiple entities, and then allowed it to be treated as one entity that can be like scaled and
rotated to fit what you wanted to do, and you can also place anchors there to scale it as you wanted.
And bitna pictures then work somewhat similar, like cluster entities, you can just import a picture
for example, like a photo of a hook for a bike bag that then I lost, so I basically took a photo,
and then use reference points in there to scale it to the right dimensions, and then use that photo
to another photo to recreate that I took that I lost. So but not only import, got some enhancements,
also export, most notably of that step export, so step export was there from day one,
but it only exported the body, like the one body at a time, and it didn't export the whole
document, but then puricust came along from someone else that had that in the way that there's
no way to export the whole document, and it has shown there, and it's been shot from a freecat,
it also retains the body colors and body names, what's still missing is exporting import
step models, but it's something that all of the kind of later if someone beats it.
So when I was working on a recent project, that involved making also, also involved making a PCB
with Horizon Media, I first did some sketches in June 3D to make up the initial board shape,
then I was liking a way to get that into Horizon Media, so that the easiest thing, and implemented
the XFX port, like it's the bare minimum of EKAT MCAT integration, but it did the job for me,
and the XFX port is also useful if you want to laser cut parts also.
So that's basically everything that happened since the 1.0 overlays, so what's next?
So while, as a disc with these softwares, the stuff that people do with it grows over time,
and one thing that also I have run into, every now and then, was that it gets quite slow
and if you have larger and more complex models, and one reason for that slowness is the
is generating the solid model with open cascade, so it don't want to, like, thank an open cascade
here so much the job it has to do is quite complex, so it, so it does no really way to speed it up,
so the way that the algorithm set is to make the solid model up as in front of us,
so it will synchronously collect all of your things, it needs to make the solid model up
it happen in the background, then it just wants an background that means you won't get to see
the solid model change right away, but you still can continue working on the document
with always waiting for the things that you might not even teach to update.
Another thing that will then soon are racial constraints, there's a podcast open,
someone else that I bought pretty much ready to be merged, but I didn't watch a couple of weeks ago
since I didn't want to put, like, features that didn't seem artistic into the release that
had just happened this week, and so while I used it, it used to deal with the media people
to do it, it used to support it on Windows and on Windows, it's somewhat usual that up the
apps implement update checks themselves, so one typically way to do that is to ask
some server for latest version, but then a friend of mine suggested well, you could do that using
a DNS and a TXT record, and as it's happened, while bought in forced-end schedule, I also
found a plug, I think it was in the go-dove room, about just that topic, about implementing
update checks using TXT records in DNS, so I think it's a two people that came up with that
probably independently, then it's probably good that year, and compared to like typing for
it at some URL, it has the advantage that it's like the most privacy, it's one of the things
that you can do, since like you only link it to your resolver that you'll ask for updates,
but then it's just DNS, and in terms of actual features, what is missing right now are
helix groups, and there's no way, no good way to do them right now, so then it was one of the
few things that solves based tasks that don't really doesn't do yet, but luckily there's code
and freecat for helix groups with open cascade, that I look at and it seems like it's something
it's code that I can reuse in new 3D, so and there are like these features that are already
quite thought out, there are some ideas that have been floating around every now and then,
one of them, you can use it to find out the parameters and the questions, since the resolver
basically just operates on symbolic equations that they give it, and it then solves
numerically, some users were asking for well-economic parameters and equations,
right now there's no way to do it other than like, simply translating your equations to constraints,
yeah what there is to some, I still haven't quite thought out how the UI should look like for that,
another thing that goes into making things more user-defined groups for user-defined arrays,
so people sometimes like cat as code programs like opmascat, since they can just write things
in for loops and so on, for well that would be quite useful, either to make some nice patterns
also, so I had a thought of integrating some small scripting language, like a duct tape JavaScript
or micro Python, introduce 3D to allow making scripted groups where you can then just place things
in a fall loop to make them look nice without having to think of using constraints for that,
and with that, that's it, and now there's the like a screenshot of 3D since I didn't find
like a good way to put it anywhere in the application and the presentation and think
wouldn't be quite complete without showing at least how the whole thing looks like, so now that's it.
Thanks a lot for me, it was something very necessary for Linux, basically for my Linux work flow
to have a catch-off tour that works more intuitively than Africa, and as I've been trying
multiple times between 3D and 3D advancements, thank you, and maybe for the ideas for the next
future, how do you call that, when you want to, how do you call it, sorry, offsets, yes, the offsets
function, so you can select edges and offset them, it's something I use all the time in CAD,
I use on shape right now because I'm obligated to, so, and if you, you can do offsets and you know
what it is, and you can, you offset a shape, and then you can apply a function to it, like extrude,
it's very useful for example, if you do a PCB, if you import a PCB from KK, you click on the edge
of the sketch, and then you can make an enclosure using enough set function to have to add some
tolerances, probably into the right. Okay, yeah, I think I got for a toolman,
the thing one way that could be implemented is as a separate offset group, that's like take
the lines from one group and then apply the offset to them, the problem, like the challenge with that
is maintaining the relation like which, like whether I think come from, since two 3D references
all things by U-IDs, in U-IDs, or basically, if you have some extrude group, the, the
IDs of the extrude lines are linked back by hash to the ID of the line that came from,
so when having something that does the offset, it has to like know what that thing originated
from that line, and it also has to deal with things like arbs, I think there's a library that can
do that, but the problem is with basic curves, and if you also also the basic curve, the offset
isn't a basic curve anymore, so you have to do some like approximation type of who make things
quite complex, but it's one of the things if there's a library that does it for me, well,
that's probably it, thanks for us, I think if you're talking, does the intrudio do you plan to
support cam integration, some sort of past generation for cam, right, or if you just made it?
Okay, so unfortunately, that's completely out of my wheelhouse, since the only thing that I do
mechanically is a 3D printing, and I don't think that I can continue with anything we need,
we need for there, so right now I just say like export a step and go into your favorite camps
of there, other questions, thank you for a talk, what about unit testing, or testing in general?
So right now, there's basically no unit testing at all, yeah, that's the state of things,
so and the things, and I thought it was a couple of times, but couldn't quite come up with
a good way how to like test the way that things still are the way they should see, and many things
are like, you are things that are quite hard to unit test, but I see well, something internally
could be unit testers, but I haven't really found a good way to make that yet, thanks.
Of course, someone in the middle of the room, sorry about the hassle, what about assemblies?
Well, assemblies are so to be fair, assemblies are supported in some way in the way that you
have multiple bodies, but the thing is these bodies themselves can't be moved independently,
so what I thought about that is that well maybe you could have some like exploit feature to
move things independently, and what's also supported is that you can have, that's what already,
is these things for document entities, that means that you can have a separate document,
and include that in another document as an entity, so you could then like edit, edit the document
in another tab, and then it updates in the thing where things will basically automatically
and you can then move and constrain that document in the document where I think you did,
there are still some limitations in that approach, most notably that the only thing that you can
basically constrain is the origin, but yeah, that's feature is not quite as developed as a
probably should be, but edit it to get the software architecture in place for that, but so far I
haven't found much use for it, so if someone really needs it, I think that something that
definitely can be done in the future, all right, thank you Lucas.