Empty fusion - exception and pling icon?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
peterf
Posts: 4
Joined: Mon Aug 01, 2022 7:56 pm

Empty fusion - exception and pling icon?

Post by peterf »

When removing the second-last object from a fusion by drag-and-drop or deletion, to leave only one object in the fusion, I get this: <Exception> Not enough shape objects linked: popping up in a control window. The fusion also gets a pling icon warning in the treeview.

This is sad because I might be removing the object temporarily, and want to leave the fusion structure behind so I can replace objects in it without having to undo and redo the top layers of the tree. Even an empty fusion in the tree can be useful, especially in cuts or layered cuts.

Now FreeCAD generally handles this situation pretty well - it actually just works with single-occupancy or empty fusions - except for the pling warning, which is also used for more serious and do-not-ignore "command not executed" situation (when in fact the fusion-emptying command has been executed); and the exception coming up in the control window is just annoying, taking up valuable screen space (and lots of it, but that's another story).

To my points:
First I don't know how many people know that empty fusions actually work, I never saw anything about them - let the people know!
Second, a feature request - can we remove the exception warning and the pling warning icon please?

If you absolutely must have something showing that a fusion has <2 members, can we use a different and less blaring icon instead please?

Incidentally drag-and-drop in the tree view is fandabbydoozy (I believe "dope" is the modern expression, but I always took that to mean cannabis resin. What with the prevalence of skunk these days, I suppose resin is uncommon and the word was just lying around empty and got reused. A bit like the word gay. Or an empty fusion in a FreeCAD tree ... 8-) ).

part workbench FreeCAD v0.19 on debian
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Empty fusion - exception and pling icon?

Post by Jee-Bee »

peterf wrote: Mon Aug 01, 2022 8:53 pm To my points:
First I don't know how many people know that empty fusions actually work, I never saw anything about them - let the people know!
It is not a empty function. What you do is breaking the function.

peterf wrote: Mon Aug 01, 2022 8:53 pm Second, a feature request - can we remove the exception warning and the pling warning icon please?

If you absolutely must have something showing that a fusion has <2 members, can we use a different and less blaring icon instead please?
The boolean union can only work with more than 2 objects. It is just impossible unite a single object because it is already a unity.
The blaring icon is exactly for the situation somebody remove an object by accident and not for layer purposes. It can lead to crashes later on!

If you want to replace an object in the Boolean Union it is better to add first a another object and then remove the previous one. Or just remove the boolean union and re-create it after creation of the new object...
peterf wrote: Mon Aug 01, 2022 8:53 pm part workbench FreeCAD v0.19 on debian
Please update to 0.20.
User avatar
Shalmeneser
Veteran
Posts: 9580
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Empty fusion - exception and pling icon?

Post by Shalmeneser »

peterf wrote: Mon Aug 01, 2022 8:53 pm FreeCAD v0.19 on debian
... is not a version. Try to follow the link in the red banner of Help Forum.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.21.29393 (Git)
Build type: Release
Branch: master
Hash: 6820e0a9ec85203a6f342ca72a2ff8fd417beaf1
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: French/France (fr_FR)
Installed mods: 
  * fasteners 0.3.50
  * fcgear 1.0.0
  * Manipulator 1.4.9
  * sheetmetal 0.2.53
peterf
Posts: 4
Joined: Mon Aug 01, 2022 7:56 pm

Re: Empty fusion - exception and pling icon?

Post by peterf »

Jee-Bee wrote: Tue Aug 02, 2022 6:19 am First I don't know how many people know that empty fusions actually work, I never saw anything about them - let the people know!

It is not a empty function. What you do is breaking the function.
An empty fusion might technically be an empty function (depending on whether you use the Bourbaki definition), but in any case I do not find it useful to think of a fusion as a function, it is far more useful to think of a fusion as a thing.

You can drag-and-drop and copy-and-paste a fusion as you can a cube or cylinder. That it may (or may not) have several other things in it is just nice.

And as far as I can tell I am not breaking anything. I repeat, in my experience empty fusions just work :)
Jee-Bee wrote: Tue Aug 02, 2022 6:19 am The boolean union can only work with more than 2 objects. It is just impossible unite a single object because it is already a unity.
Again it depends on definitions and point of view, but generally speaking in mathematics a Boolean function can still (exist and) operate even if all the input objects are elements of the empty set.
Jee-Bee wrote: Tue Aug 02, 2022 6:19 am The blaring icon is exactly for the situation somebody remove an object by accident and not for layer purposes.
One bad thing (among many) about the blaring icon is that it obscures the difference between a cut and a fusion. Not so important when you are working with no blaring icons. but if you have to have them on you can't tell the difference between a cut and a fusion in the tree view.

The blaring icon should only be used for things you have to fix right now.
Jee-Bee wrote: Tue Aug 02, 2022 6:19 am It can lead to crashes later on!
Now here's the rub. But can it? How? In my experience it has never caused a crash, and I do it a lot. Like every day.

My typical workflow tree might look like this, in fact I usually copy and paste this structure into a new file:

> [cut icon] thing
> [fusion icon] in
. > [fusion icon] out

This turns drag-and-drop from a pretty good idea into a thing of beauty and extreme usefulness.
Jee-Bee wrote: Tue Aug 02, 2022 6:19 am If you want to replace an object in the Boolean Union it is better to add first a another object and then remove the previous one. Or just remove the boolean union and re-create it after creation of the new object...
The second is not really an option because you then have to undo and redo everything in the tree above the union.
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Empty fusion - exception and pling icon?

Post by onekk »

peterf wrote: Tue Aug 02, 2022 10:52 am An empty fusion might technically be an empty function (depending on whether you use the Bourbaki definition), but in any case I do not find it useful to think of a fusion as a function, it is far more useful to think of a fusion as a thing.
....
And as far as I can tell I am not breaking anything. I repeat, in my experience empty fusions just work :)
Sadly in FC what you see in the treeview is a "DocumentObject" not a generic "thing":

https://wiki.freecadweb.org/App_DocumentObject
peterf wrote: Tue Aug 02, 2022 10:52 am Again it depends on definitions and point of view, but generally speaking in mathematics a Boolean function can still (exist and) operate even if all the input objects are elements of the empty set.
This is not an academic discussion, point of view "should rely" on how the software is build upon.

Simply FC is not done as other software, and it is not a mathematical text. It is a CAD program with his rules and conventions, not an "abstract text".

peterf wrote: Tue Aug 02, 2022 10:52 am One bad thing (among many) about the blaring icon is that it obscures the difference between a cut and a fusion. Not so important when you are working with no blaring icons. but if you have to have them on you can't tell the difference between a cut and a fusion in the tree view.

The blaring icon should only be used for things you have to fix right now.
A cut and a fusion are not the same thing, It seems to me that are different things, probably the icon you intend is one of the "Part Design WB" or probably I have not seen the place where you wrote this information.

You are missing some important informations, you didn't comply to the requisite to make a useful post:

https://forum.freecadweb.org/viewtopic.php?f=3&t=2264

And this is a request made by @Shalmeneser in his answering post.

Plus you are not telling us what WB you are using, as FC could do Boolean in at least two different WB.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
peterf
Posts: 4
Joined: Mon Aug 01, 2022 7:56 pm

Re: Empty fusion - exception and pling icon?

Post by peterf »

onekk wrote: Tue Aug 02, 2022 1:26 pm Sadly in FC what you see in the treeview is a "DocumentObject" not a generic "thing":

https://wiki.freecadweb.org/App_DocumentObject
From which:
"In general terms, a "DocumentObject" is any "thing" that can appear in the Tree view"
onekk wrote: Tue Aug 02, 2022 1:26 pm [Simply FC is not done as other software, and it is not a mathematical text.
Comes from being a retired mathematicin.
onekk wrote: Tue Aug 02, 2022 1:26 pm A cut and a fusion are not the same thing, It seems to me that are different things, probably the icon you intend is one of the "Part Design WB" or probably I have not seen the place where you wrote this information.
I have no idea why you might think I think a cut and a fusion might be the same thing.

Possibly you missed it, but at the end of my first post I wrote: "part workbench FreeCAD v0.19 on debian"

I didn't give my exact version info because it isn't relevant to this thread - I gave only and all the relevant information. I am not asking for help, but for a feature request.
onekk wrote: Tue Aug 02, 2022 1:26 pm And this is a request made by @Shalmeneser in his answering post.

Plus you are not telling us what WB you are using, as FC could do Boolean in at least two different WB.
@Shalmeneser did not ask which workbench I was talking about. I have no idea where that "quote" came from.

Peter Fairbrother

To keep you happy - perhaps someone may be collecting data on which versions are in use - here is my version etc info:

part workbench
OS: Debian GNU/Linux 11 (bullseye) (MATE/lightdm-xsession)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United Kingdom (en_GB)
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: Empty fusion - exception and pling icon?

Post by adrianinsaval »

In this case I don't think there's any difference but as a general rule you should check the latest version before making requests, sometimes people ask for things (and many times not very nicely) that are already implemented in newer versions but they didn't bother to check.
Personally I don't see an usecase for an empty fusion, can you give an example of when you would use this?
peterf wrote: Mon Aug 01, 2022 8:53 pm (when in fact the fusion-emptying command has been executed)
Actually the fusion operation is not even attempted if there aren't enough arguments so this is not true, see:
https://github.com/FreeCAD/FreeCAD/blob ... e.cpp#L111
I don't know how occt behaves when you ask for a fusion without any argument.
peterf
Posts: 4
Joined: Mon Aug 01, 2022 7:56 pm

Re: Empty fusion - exception and pling icon?

Post by peterf »

adrianinsaval wrote: Tue Aug 02, 2022 6:53 pm Personally I don't see an usecase for an empty fusion, can you give an example of when you would use this?
Hmmm, recently had a handle for a needle felting tool with a cut hole fusion for a switch about three or four levels deep in a tree. The original switch is no longer available, and I had to change the cutout to fit the new switch. Removed the existing cut out hole but left the empty fusion where it was, and then looked at the result with a view to choosing a better position for the new switch.

Then put the new cut hole into the empty fusion in the cut (the cutouts themselves are about three things wide and two levels deep). If I couldn't use an empty fusion in this way I might well have had to undo and redo all the higher levels in the tree, which would have been horrible.

Can think of many more examples.

adrianinsaval wrote: Tue Aug 02, 2022 6:53 pm (when in fact the fusion-emptying command has been executed)

Actually the fusion operation is not even attempted if there aren't enough arguments so this is not true, see:
https://github.com/FreeCAD/FreeCAD/blob ... e.cpp#L111
Ah there's the culprit, or one of them!

You are right (though the fusion seems to be emptied first), which explains some things which had puzzled me. Mostly I use fusions with at least one object in them, which seems to just work when I remove or replace further objects, or as above.

I don't know when the if case you refer to is called, but I can't see any need for it and it just gets in the way. If you have a fusion with one object in it, what harm does that do? Just treat it like the object inside it. If there is nothing in it, treat it like .. nothing. The advantage of this is that if the fusion is deep in the tree you can remove or add things from it without having to change the higher levels of the tree.

On something related, I recently had a cylinder acting as a hole in a cut about five levels deep in a tree. Decided two holes would be better. It would be nice if I could simply turn the existing hole into a fusion containing the hole, then add another hole to the fusion, so I don't have to delete the cut and perhaps everything above it in the tree.

Or is there another way?

After all the main point of basing FreeCAD on a tree structure is so you can change the tree and it is then recomputed. Don't want to have to undo then redo the higher levels of the tree every time I want to change a small detail deeep down ... So, any tools to easily and directly edit the tree would be good :)
adrianinsaval wrote: Tue Aug 02, 2022 6:53 pm I don't know how occt behaves when you ask for a fusion without any argument.
Sorry, I don't know what occt is. You can copy and paste a cut of two empty fusions in FreeCAD, if that helps.

BTW someone seems to have transferred this thread from General-Discussion to Help-on-using-FreeCD. Is that appropriate?

Peter Fairbrother
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: Empty fusion - exception and pling icon?

Post by adrianinsaval »

occt is the geometric kernel, it's the library that actually perform the operations. That line I linked is inside the execute() function, which as the name suggests is called anytime the object is recomputed. Inside that if block are calls to the occt function to make a fuse. I have no strong opinion on this subject.
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Empty fusion - exception and pling icon?

Post by kisolre »

All those operations make perfect sense with 1 or zero inputs so limiting the user is not necessary.
Post Reply