Boolean operations on bodies not working

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!
wormball
Posts: 7
Joined: Sun Dec 02, 2018 10:52 am

Boolean operations on bodies not working

Post by wormball »

Hello!

When i try to perform partdesign boolean operation on bodies, it either crashes immediately, or freezes and consumes all the available memory, or ends the operation successfully, but the result is completely invisible regardless of any space key depressions at the model tree. Moreover, when i try to do something with the result, e. g. edit some sketch or even save and load the file again, it either crashes immediately, or freezes and consumes all the available memory so i have to kill it manually. It happens every time i try partdesign boolean, whether it is any other file, freecad 0.19 and/or under windows 10.

Is this the intended behavior? If yes, why the manual says it does something else? https://wiki.freecadweb.org/PartDesign_Boolean If not, is there a way to make it work like the manual says?

Thanks in advance.

P. S. Also your forum freezes drastically (on 4/8 core xeon!) and shuffles attachment comments.

OS: Ubuntu 18.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Russian/Russia (ru_RU)
Attachments
pb6_case_bool.FCStd
after (not exactly but basically the same)
(62.18 KiB) Downloaded 21 times
pb6_case.FCStd
before
(41 KiB) Downloaded 22 times
Bance
Veteran
Posts: 4274
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Boolean operations on bodies not working

Post by Bance »

Works OK for me....
Bool.jpeg
Bool.jpeg (41.46 KiB) Viewed 1279 times
OS: Linux Mint 18.2 Sonya (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.5.2
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean operations on bodies not working

Post by chrisb »

wormball wrote: Sun Apr 05, 2020 10:42 am Version: 0.18.4.
Please don't post any errors based on 0.18 only. Check if the error exists in 0.19 (as well).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wormball
Posts: 7
Joined: Sun Dec 02, 2018 10:52 am

Re: Boolean operations on bodies not working

Post by wormball »

I have installed freecad-daily.

OS: Ubuntu 18.04.4 LTS (GNOME-Flashback:GNOME:/gnome-flashback-metacity)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Russian/Russia (ru_RU)

Now it performs the desired operation (maybe 0.19 changed since i last tried it) but the result looks slightly odd when semi-transparent.

However i have found a workaround: https://youtu.be/lb-oPWEUQ30?t=1070 . So you choose part workbench, click "boolean", choose part design again and click "body". And all is fine and looking nice.
Attachments
Снимок экрана от 2020-04-05 17-33-05.png
Снимок экрана от 2020-04-05 17-33-05.png (260.72 KiB) Viewed 1251 times
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean operations on bodies not working

Post by chrisb »

It looks as if you have two objects visible at the same time which occupy the same space. This leads to the so called Z-fighting.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wormball
Posts: 7
Joined: Sun Dec 02, 2018 10:52 am

Re: Boolean operations on bodies not working

Post by wormball »

I hit space on every tree entry, but it did not help.
Attachments
pb6_case_019.FCStd
(52.84 KiB) Downloaded 22 times
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean operations on bodies not working

Post by chrisb »

I can confirm the Z-fighting issue. It is a regression, possibly introduced by the Big Merge?

It was already present in this version from shortly after the big merge:

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17798 (Git)
Build type: Release
Branch: master
Hash: 7e60631239109c632a8f6cca83f6e7e5502e43a1
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)

It was not present in this version from shortly before the big merge:

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17681 (Git)
Build type: Release
Branch: master
Hash: e94af7ff5e873f263cac51d7d47df68eca183250
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
realthunder wrote:ping
wmayer wrote:ping
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Boolean operations on bodies not working

Post by realthunder »

chrisb wrote: Sun Apr 05, 2020 9:20 pm I can confirm the Z-fighting issue. It is a regression, possibly introduced by the Big Merge?
No, this is caused by the recent change of default Lighting. Change it to double-side rendering can fix the problem.

lighting.gif
lighting.gif (371.93 KiB) Viewed 1186 times

wmayer wrote:ping
Maybe auto change to double-side rendering when there is transparency?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean operations on bodies not working

Post by chrisb »

realthunder wrote: Sun Apr 05, 2020 10:29 pm Maybe auto change to double-side rendering when there is transparency?
Sounds reasonable.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Boolean operations on bodies not working

Post by wmayer »

wormball wrote: Sun Apr 05, 2020 10:42 am When i try to perform partdesign boolean operation on bodies, it either crashes immediately, or freezes and consumes all the available memory
You should check the user settings under Edit > Preferences > Part design > Shape view for Maximum deviation from the model bounding box. By default this value is set to 0.5 % which is a good compromise between meshing speed/RAM usage and appearance quality. If you set it to a very low value you get a nicer rendering result but the meshing can require much more time and the RAM usage increases, too.
chrisb wrote: Sun Apr 05, 2020 9:20 pm I can confirm the Z-fighting issue. It is a regression, possibly introduced by the Big Merge?
In this context it's helpful to understand that when transparencies are used in a model there is no guarantee that everything works perfectly in all cases:
SoGLRenderAction::TransparencyType

Many years ago we used the option SORTED_OBJECT_BLEND in FreeCAD but switched to SORTED_OBJECT_SORTED_TRIANGLE_BLEND a few years ago which fixed some rendering artifacts.

But still you can easily run into unexpected behaviour. There is/was a bug in Mantis where depending on the view position an object was incorrectly rendered opaque and transparent for other view positions.
realthunder wrote: Sun Apr 05, 2020 10:29 pm No, this is caused by the recent change of default Lighting. Change it to double-side rendering can fix the problem.
For the others: In v0.19 a new option in the preferences was added to set the lighting mode for Part objects (One-side or Two-side rendering). In the past you could change this only in the property editor for each object manually but there was no global option. The default was Two-side rendering but this option is not unproblematic because it hides possible problems in your model. If faces have inconsistent orientations then e.g. this can lead to problems for boolean operations. That's why I decided to set to default to One-side rendering when adding this user setting.

The downside is that when transparencies are used you get the Z-fighting issue. I don't mind to restore the old default value, i.e. to set Two-side rendering but you must be aware of that it's not obvious and easy to see if your model suffers from broken orientations.
Furthermore as soon as you hover over a face or select it the Z-fighting issue is back -- independent if One-side or Two-side rendering is used.
realthunder wrote: Sun Apr 05, 2020 10:29 pm Maybe auto change to double-side rendering when there is transparency?
I am no friend of too many automatisms where it's not clear if the behaviour is the same on all platforms. Then it's easier to set again Two-side rendering as default but leave the user the possibility to change the settings.
Post Reply