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

Re: Unable to perform Boolean operations in mesh mode

Post by s_hemer »

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
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to perform Boolean operations in mesh mode

Post by wmayer »

wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to perform Boolean operations in mesh mode

Post by wmayer »

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

Re: Unable to perform Boolean operations in mesh mode

Post by s_hemer »

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 32 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Unable to perform Boolean operations in mesh mode

Post by TheMarkster »

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

Re: Unable to perform Boolean operations in mesh mode

Post by s_hemer »

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
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Unable to perform Boolean operations in mesh mode

Post by wmayer »

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

Re: Unable to perform Boolean operations in mesh mode

Post by s_hemer »

Thanks for the clarification (and fix). The airchannel was meshed with (or from) FreeCAD itself while the other part was, as I already wrote, imported.

I ended up reworking that part as well and doing the substraction with the two FreeCAD parts. Worked for a first prototype but I came across a bunch of other issues (the funny renaming/renumbering of edges/faces/points, resulting in broken references in following steps (can't they be updated/derived?, Fillet can't be applied because of residual edges, refining shape removes them but Fillet still can't be applied, copying of a part with Shape binders creates also copies of the original shapes... ).

Really sad that all this lowers the very nice first impressions of FreeCAD. Surely, FreeCAD is an ambitious project and so on, but it would be really nice to see such basic things working more flawlessly. At least, I gained some experience (let's see where/how to share).
Attachments
freecad_forum_upload2.png
freecad_forum_upload2.png (37.66 KiB) Viewed 801 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Unable to perform Boolean operations in mesh mode

Post by vocx »

s_hemer wrote: Mon Dec 30, 2019 11:23 am ...(the funny renaming/renumbering of edges/faces/points, resulting in broken references...
This is the topological naming problem.

FreeCAD is pretty good at creating complex models. But users without experience are easily tripped by some quirks that are trying to be solved. If they were simple things they would have been solved a long time ago. They are complex issues.

Take a look at the users showcase subforum where you can see pretty impressive, real models.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
s_hemer
Posts: 7
Joined: Tue May 28, 2019 8:42 pm

Re: Unable to perform Boolean operations in mesh mode

Post by s_hemer »

Totally understand the problem, I just can't remember to have had this problem in a CAD software I once used at work. But thanks for the link and the correct term of that issue. I will definitively stay with FreeCAD.
Post Reply