Boolean cut fails after 3D-Offset padding

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!
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Boolean cut fails after 3D-Offset padding

Postby PepperSoris » Thu Nov 08, 2018 8:17 am

Hello,
does anyone know, why the boolean cut in the attached example fails?
I want to make a cage for a simple M4 nut. I have the model for the M4 nut and want to subtract it from a simple solid block, but with a little clearance margin.
So I used the Part->3D-Offset to make a little 0,5 mm offset (with the option for straigt intersecting faces).
The padded nut looks fine, but when I do the boolean cut (select first the Block1 and then the Offset-Nut), the cut fails. (Without an explicit error message.)

What is really strange: if I delete the 3D-Offset, and do the boolean cut with just the plain M4 nut, the cut succedes!
How can this be fixed to work with the offset, because I need the little wiggle room to fit the two parts together afterwards. I know, I could simply draw a scetch of the hex nut (or use a projection), but the workflow with the padding and boolean cut just seems the most elegant way.

Thank you in advance for any hints!
freecad bug - boolean cut.png
freecad bug - boolean cut.png (15.66 KiB) Viewed 336 times
--------
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
Attachments
Problem with Boolean Cut.FCStd
(14.88 KiB) Downloaded 10 times
chrisb
Posts: 18038
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean cut fails after 3D-Offset padding

Postby chrisb » Thu Nov 08, 2018 8:57 am

Therror vanishes if you recompute the whole document. However, here remain some Z-fighting like artefacts in the display.
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Re: Boolean cut fails after 3D-Offset padding

Postby PepperSoris » Thu Nov 08, 2018 9:08 am

Dear chrisb,
If I right-click the "Cut" item and then "Mark to recompute" nothing changes. There error icon is still there. Same behaviour when I select the document root and right-click "mark to recompute". How did you "recompute the whole document" ? Is this a menu item somewhere?

If I hide all the other items except the cut, I have an empty screen (because the "cut" operation failed).

I just found out, that if instead of the Part->Boolen->Cut operation, I use the Part->Boolean->Boolean... operation it fill fail for all methods with the error message "Performing intersection on non-solids is not possible".

So it seems the 3D-Offset generated a non-solid object. But why? It looks like a pretty decent solid to me. ;)
Freecad - boolen cut 2.png
Freecad - boolen cut 2.png (33.51 KiB) Viewed 325 times
User avatar
Chris_G
Posts: 1104
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Boolean cut fails after 3D-Offset padding

Postby Chris_G » Thu Nov 08, 2018 9:50 am

PepperSoris wrote:
Thu Nov 08, 2018 9:08 am
So it seems the 3D-Offset generated a non-solid object. But why? It looks like a pretty decent solid to me. ;)
Your M4 Nut object is a solid encapsulated inside a compound.
I think that's why the 3D offset didn't generate a solid.
Attachments
Problem with Boolean Cut-2.FCStd
(24.24 KiB) Downloaded 4 times
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Re: Boolean cut fails after 3D-Offset padding

Postby PepperSoris » Thu Nov 08, 2018 10:14 am

Your M4 Nut object is a solid encapsulated inside a compound.
How do you know that? I can't see it anywhere in the object tree. To me, it just looks like a simple solid (Icon: blue box).

I converted the shell that is generated by Part->"3D-Offset" to a solid by Part->"Convert to solid".

Now the boolean cut works! Problem solved.

Lessons learned: the cut Operation should throw an error like "Object not a solid. Please make it a solid first..."
---
freecad boolen cut solved.png
freecad boolen cut solved.png (15.3 KiB) Viewed 319 times
User avatar
Chris_G
Posts: 1104
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Boolean cut fails after 3D-Offset padding

Postby Chris_G » Thu Nov 08, 2018 10:31 am

PepperSoris wrote:
Thu Nov 08, 2018 10:14 am
How do you know that? I can't see it anywhere in the object tree. To me, it just looks like a simple solid (Icon: blue box).
By doing a Part -> Check Geometry on the object :
check_geom.jpg
check_geom.jpg (28.86 KiB) Viewed 312 times
freecad-heini-1
Posts: 5753
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Boolean cut fails after 3D-Offset padding

Postby freecad-heini-1 » Thu Nov 08, 2018 1:41 pm

An easy hack, use the sketcher in PartDesign and draw a regular hexagon polygone , circle in the center.
Then create a pocket.
chrisb
Posts: 18038
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean cut fails after 3D-Offset padding

Postby chrisb » Thu Nov 08, 2018 4:18 pm

Good to see you got it sorted.

For the sake of completeness: Recompute is done in two steps:
1) Select the item or the whole document for recompute, that's what you had done.
2) Click the recompute icon with the two blue circular arrows or hit Ctrl+R (Macos: Cmd+R)
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Re: Boolean cut fails after 3D-Offset padding

Postby PepperSoris » Fri Nov 09, 2018 6:33 am

Should I file a bug reports for this?
  1. Part->Boolean->Cut should show error message if a non-solid (Shell, etc.) is selected. (at least in the console window)
    Bug report: issue #3694
  2. Part->3D-Offset should warn if resulting object is not a solid (or add option to try to make it one)
    Bug Report: issue #3703