Assembly container icon

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Assembly container icon

Post by Zolko »

There have been many discussions about assembly files/containers for FreeCAD, some of which can be found here and here and here.

Currently, with FreeCAD v0.19, you can build fully functional assemblies using only core FreeCAD App::Part - App::Link and PartDesign::Body objects. There is no need for extra workbenches, the workbenches provide solvers to position parts inside an assambly as well as convenience tools to create such assemblies. The App::Part container was designed specifically to be the assembly container (see
https://wiki.freecadweb.org/Std_Part) :

The Std Part is intended to be the basic building block to create assemblies

This container has been introduced in v0.17, and is now very stable. It has been made fully compatible with the App::Link interface, and both provide a solid foundation to build large assemblies. It would be a pity to re-develop something from skratch where we already have a good solution.

BUT : some people seem to like the idea of a specific assembly container, and are unconvinced of the "old" App::Part (Std_Part) object and want something more "modern".

Fortunately, the coders of the Stad_Part have foreseen this and provide a default property called "Type", which is a string and empty at creation time. I propose hereby to make an extension to the existing Stad_Part and use that "Type" property to adapt the icon shown in the tree: by default, the traditional "Part" container is shown,

Image

and when the Type property is set to "Assembly" a modified icon is shown:

Image

It would look like this is the real usage:
Geoassembly.png
Geoassembly.png (152.67 KiB) Viewed 2663 times


I'm preparing a pull-request. Which is not only visual, but also a de-facto confirmation about the fact that tha App::Part container IS the FreeCAD assembly container. But this is also a confirmation that FreeCAD is nearing stability, as we are refining existing objects to extend the feature-rich functionality. By switching back to the pre-0.19 yellow Part icon we also show make life easier for existing documentation.

PR is here: https://github.com/FreeCAD/FreeCAD/pull/4928
Last edited by Zolko on Sun Jul 18, 2021 6:38 pm, edited 1 time in total.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Assembly container

Post by saso »

I have been arguing and advocating about this for years, IMO a lot of wasted time with all the other "experiments"... However, IMO this should work automatically because the only meaningful way for an assembly tree (hierarchy) structure is that when a part container has other part containers inside of it, it becomes an assembly container, this is IMO just a fact and it makes no sense to let inexperienced users mess with this structure (and waste the time of experienced users by manually setting this). This is also how other parametric cad system work that use a single container for both part and assembly (a part container automatically becomes an assembly container when it has other part containers inside) and the structure by itself is true also for all those cad systems that use separate part and assembly file types (so to say you cannot for example put an assembly in a part).

Thumbs up from me also on getting back to the basic icons as that change to the Part icon seem as an unnecessary complication to me.

And I am also supporting to keep the single file type since in my view it is a superior solution, and specially for FreeCAD with its very diverse user base. It allows both to have a single file project (in this case the file acts actually more as a database since the container type (part/assembly) is not directly represented by the file type) but if the user absolutely wants such "file/directory" structure it can actually be done, with a little disciple, by saving all the parts as individual files, keeping those files that represent assembly containers just for collection of parts (no geometry modelling) and linking all of it with the link functionality... This two different ways of managing a project could actually be automated, for example imagine a menu entry "save part/assembly structure as individual files" and vice versa for a project that was created as individual files for all the parts "combine all parts to a single project file", and of course one could also manage it in a hybrid way between the two, important thing to understand is that the tree/hierarchy structure is always the same... Yes, it can get in some way more complicated and gives more responsibility to the user to manage this properly, but who cannot see how powerful this actually is, is just ignorant. We should also not forget that FreeCAD is in generally used by many different users that have different expectations and needs from an CAD system, and while I am very much supporting the development of a good and proper part/assembly structure, forcing this structure on everyone is IMO a no go for FreeCAD.
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: Assembly container icon

Post by jonasb »

What I'd find helpful if the icon could reflect whether a) the part has child parts, and b) (more important) whether the part "owns" all its children or that there are links outside.

This could also go along with changing the part icon it if is actually a link, maybe an overlay. Right now (0.20.25025) a "real part" and a "link to a part" are represent in the same way in the tree; you have to look at the data to tell them apart.

If all this is possible without the user (or a tool) having to set the "Type" of a part, the better.
User avatar
obelisk79
Veteran
Posts: 1094
Joined: Thu Sep 24, 2020 9:01 pm

Re: Assembly container icon

Post by obelisk79 »

Would there be any merit to have icons that differentiate between an Assembly and Sub-Assemblies?

I can't necessarily think of one, as it should be relatively obvious in the tree view. However, nested assemblies did come to mind, and I figure that it may be worth discussion here.
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Assembly container icon

Post by adrianinsaval »

why not the current yellow blue and green icon for assemblies and the old for regular parts
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly container icon

Post by Zolko »

adrianinsaval wrote: Mon Jul 19, 2021 2:04 pm why not the current yellow blue and green icon for assemblies and the old for regular parts
Yes, indeed, why not. But that's not the core of the subject: it is to have different icons for a standard part depending on its "Type" property. Currently, this information/property is not used. In this proposal it concerns only "Assembly" types, but we could think about other uses: "Ship", "House" ...
try the Assembly4 workbench for FreCAD — tutorials here and here
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Assembly container icon

Post by carlopav »

... Building storey....
follow my experiments on BIM modelling for architecture design
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: Assembly container icon

Post by jonasb »

Zolko wrote: Wed Jul 21, 2021 11:20 pm ... it is to have different icons for a standard part depending on its "Type" property.
For this alone I fail to see the benefit. I do see benefits of having some special icon for "this part has child parts" or "this part has children which link outside" (this could be seen as a definition for "an assembly"). But just having a string property telling "I'm an assembly"? -- maybe you need to elaborate further on this.

(Just to be clear: Asm4 successfully demonstrated that there is no need for an additional "assembly container" beyond Std_Part; I'm not arguing against that point.)
drmacro
Veteran
Posts: 8984
Joined: Sun Mar 02, 2014 4:35 pm

Re: Assembly container icon

Post by drmacro »

umm...but, wasn't the early discussion in this thread about the Type would/could allow multiple assembly object types to be used in the Part container and the icon would clue the users that they were different?
🤔

Maybe I lost the thread somewhere along the way. :mrgreen:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly container icon

Post by Zolko »

jonasb wrote: Thu Jul 22, 2021 8:03 pm But just having a string property telling "I'm an assembly"? -- maybe you need to elaborate further on this.
The starting point is that there are repeated requests for a specific assembly format. Some people argued that the Std_Part was meant to be such an assembly container (and Asm4 has proved that it's perfectly usable for the task) and a new Geofeaturegroup icon was decided to reflect this fact: Std_Part are assembly containers.

But this created a new problem: what about existing files and users ? They will see their old project suddenly with a new icon. Also, all documentation for App::Part will show the yellow icon, and thus this documentation will be obsolete for v0.20. By solving the assembly container problem we have created a new problem for existing data.

What you propose (re-children) might be better, or not, but it's certainly going to be complex to code: I would not be able to do it. FreeCAD is about engineering, and engineering is about solving real problems in a practical way.

This proposal solves both problems: it keeps existing projects and documentation up-to-date, all the while adding a new object for assemblies. And it does so by re-using existing code in FreeCAD, thus keeping the stability that we have come to expect since v0.19. All I did was to add 5 lines of code, and only in the GUI. It is also very easy to explain and understand: an assembly is an App::Part with Type set to "Assembly". It is a simple solution to a real problem.
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply