Unable to perform Boolean operations in mesh mode

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!
s_hemer
Posts: 5
Joined: Tue May 28, 2019 8:42 pm

Re: Unable to perform Boolean operations in mesh mode

Postby s_hemer » Thu Jun 06, 2019 2:07 pm

Ok, I can report back that
a) Changing my install from freecad-python2 (which was chosen by default when installing freecad package on 18.04) to freecad-python3 (and of course removing freecad-python2 and all otherwise unused dependencies) works with the old OpenSCAD 2015.03-2+dfsg-2~18.04 from their PPA (which has not been updated yet, unfortunatelly)
b) it works with a simple example (cube/sphere difference) but with my initial meshes their seems to be another issue most likely with the mesh itself I assume (OpenSCADUtils.OpenSCADError: ' ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!\nExpr: e_below != SHalfedge_handle()\nFile: /usr/include/CGAL/Nef_3/SNC_FM_decorator.h\nLine: 426\nCurrent top level object is empty.\n'). Will further dig into that.

Two thing I'd suggest for improvement:

- Whether to fix the python2 variant or not (I understand that it might not be worth the effort) it would be nice that, if possible (depending on system), the python3 variant is installed by default.
- For the new error, it would be nice to not just see the same 'Unknown error' dialog in Mesh Design but a more telly one. OpenSCAD view shows the error on the output window which, I guess, was activate by myself otherwise it would have been quiet.

Just thoughts, trying to improve this cool piece of software.
wmayer
Site Admin
Posts: 14988
Joined: Thu Feb 19, 2009 10:32 am

Re: Unable to perform Boolean operations in mesh mode

Postby wmayer » Fri Jun 07, 2019 11:12 am

wmayer
Site Admin
Posts: 14988
Joined: Thu Feb 19, 2009 10:32 am

Re: Unable to perform Boolean operations in mesh mode

Postby wmayer » Fri Jun 07, 2019 11:15 am

- For the new error, it would be nice to not just see the same 'Unknown error' dialog in Mesh Design but a more telly one. OpenSCAD view shows the error on the output window which, I guess, was activate by myself otherwise it would have been quiet.
Can you offer some test data so that we can check the behaviour of OpenSCAD?
s_hemer
Posts: 5
Joined: Tue May 28, 2019 8:42 pm

Re: Unable to perform Boolean operations in mesh mode

Postby s_hemer » Thu Jul 18, 2019 8:21 pm

Sorry, I didn't find time in the last weeks to have a look on this problem. I checked another way as well: creating solids from the meshes and take the difference from them but it also fails (the one solid seems to have errors, removed them again as the file was to big).

Find the example attached. It is the CNC router base (from https://www.thingiverse.com/thing:3397013) where I want to remove the airchannel shape (Difference Base-Channel).
Attachments
test.FCStd
(131.55 KiB) Downloaded 6 times
TheMarkster
Posts: 1061
Joined: Thu Apr 05, 2018 1:53 am

Re: Unable to perform Boolean operations in mesh mode

Postby TheMarkster » Thu Jul 18, 2019 11:28 pm

When I open your file I see 2 different meshes, airchannel and makitabase. If you want to get rid of airchannel just delete it.
s_hemer
Posts: 5
Joined: Tue May 28, 2019 8:42 pm

Re: Unable to perform Boolean operations in mesh mode

Postby s_hemer » Fri Jul 19, 2019 5:44 pm

Did you mean that serious? How else do you say when you do a boolean difference operation: remove mesh B from mesh A, so of course two meshes. After that binary boolean operation I assume a single mesh C to be the result (C = A && !B).
wmayer
Site Admin
Posts: 14988
Joined: Thu Feb 19, 2009 10:32 am

Re: Unable to perform Boolean operations in mesh mode

Postby wmayer » Wed Nov 06, 2019 4:19 pm

The suggestion is indeed not very helpful.

I checked the boolean cut with your test file and I can confirm the behaviour. However, the actual failure is something OpenSCAD or CGAL-specific which I cannot fix.

But the shown error message isn't very helpful either because it makes the user believe that OpenSCAD couldn't be found. This has been fixed with git commit 7415e3602

If you display the meshes in wireframe or flat lines mode you will see they have many skinny triangles which from a numerical point of view is very problematic. Maybe that's why CGAL fails to process the cut operation. So, what you can try is to re-mesh your meshes with an external application like OpenFlipper or maybe MeshLab.