Boolean errors in part workbench

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!
jgamble
Posts: 3
Joined: Thu May 30, 2019 4:20 am

Boolean errors in part workbench

Postby jgamble » Thu May 30, 2019 4:46 am

Hi All,

I'm having a strange problem with Boolean operations in the part workbench since updating FreeCAD versions.

Details of current version:
OS: macOS 10.14
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: (HEAD detached at 0.18.2)
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)


When I attempt to intersect the following parts:
Screen Shot 2019-05-29 at 9.30.09 PM.png
Starting geometry
Screen Shot 2019-05-29 at 9.30.09 PM.png (40.53 KiB) Viewed 199 times

I get the following result:
Screen Shot 2019-05-29 at 9.30.53 PM.png
Result of buggy intersection
Screen Shot 2019-05-29 at 9.30.53 PM.png (27.66 KiB) Viewed 199 times

In the following older version of FreeCAD (details below), this works fine:
OS: Mac OS X
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: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)


The resulting (correct) intersection is:
Screen Shot 2019-05-29 at 9.38.43 PM.png
Correct intersection
Screen Shot 2019-05-29 at 9.38.43 PM.png (10.7 KiB) Viewed 199 times

Geometry file is attached - thanks in advance for any help, and sorry if I missed this issue being reported already!

Cheers,
John
Attachments
built_simplified.FCStd
Geometry file
(14.35 KiB) Downloaded 12 times
chrisb
Posts: 18185
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean errors in part workbench

Postby chrisb » Thu May 30, 2019 11:43 am

This is coming from the OCC kernel. Different versions seem to handle the so called coplanar issue differently. The should be avoided anyway whenever possible. If you move shape_2 by e.g. -10nm it succeds.
likewei92
Posts: 1
Joined: Thu May 30, 2019 3:48 pm

Re: Boolean errors in part workbench

Postby likewei92 » Thu May 30, 2019 3:52 pm

What is the coplanar issue and why should this be avoided? Why is this not just a bug? If it's not a bug, the recommendation is to slightly move one of the shapes?
jgamble
Posts: 3
Joined: Thu May 30, 2019 4:20 am

Re: Boolean errors in part workbench

Postby jgamble » Thu May 30, 2019 4:46 pm

Thanks for the response and advice!

Can you please elaborate on the precise move (direction, too) you're using that makes it work? I've tried a variety of moves and it doesn't seem to fix it for me, and I'd love to have this workaround.

Also, is there a bug report in OCC that you know about? It seems like something that should be easy to catch with a test, and I'd be happy to follow up on that in the right venue.

Cheers,
John
chrisb
Posts: 18185
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean errors in part workbench

Postby chrisb » Thu May 30, 2019 5:25 pm

The coplanar issue is the situation where faces are coplanar, i.e. the faces occupy so to say "the same space". Boolean operations tend to fail for such situations.
This is indeed a bug, which is well known, but there is no possibility for fixing this, as it comes from the OCC geometric kernel.

I attach the file modified according to the explanation above.

OS: macOS 10.13
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16822 (Git)
Build type: Release
Branch: master
Hash: 243aebf2dfbfe192b5bbd067020a5318a0fa8d0d
Python version: 3.7.3
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
built_simplified_cb.FCStd
(19.04 KiB) Downloaded 4 times
jgamble
Posts: 3
Joined: Thu May 30, 2019 4:20 am

Re: Boolean errors in part workbench

Postby jgamble » Thu May 30, 2019 5:35 pm

Thanks! Unfortunately, when I look at the attached FreeCAD file, things still appear to be weird with the intersection (just in a different way). The left side of the resulting arch doesn't appear to be solid (it's missing an interior face). For me it looks like this:
Screen Shot 2019-05-30 at 10.33.24 AM.png
missing face
Screen Shot 2019-05-30 at 10.33.24 AM.png (28.34 KiB) Viewed 149 times
Does it look like that to you, too?

Cheers,
John
chrisb
Posts: 18185
Joined: Tue Mar 17, 2015 9:14 am

Re: Boolean errors in part workbench

Postby chrisb » Thu May 30, 2019 6:12 pm

Yes, it is here the same. If you perform in Part workbench CheckGeometry with BOP Check enabled the result shows lots of self intersections. This is perhaps due to the vertically only slightly inclined faces not being separated enough.
kisolre
Posts: 1359
Joined: Wed Nov 21, 2018 1:13 pm

Re: Boolean errors in part workbench

Postby kisolre » Thu May 30, 2019 6:44 pm

chrisb wrote:
Thu May 30, 2019 5:25 pm
I attach the file modified according to the explanation above
In your file shape_2 has errors. With the file from the original post and shape_2 at z=-100nm it works ok
built_simplified_kiss.JPG
built_simplified_kiss.JPG (95.47 KiB) Viewed 128 times

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16687 (Git)
Build type: Release
Branch: master
Hash: ff1fb11af15a7c5f7f0ba3ef79588e128f397c2c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
Attachments
built_simplified_kiss.FCStd
(23.86 KiB) Downloaded 3 times