I had a look at this issue now:jnxd wrote: ↑Fri Mar 25, 2022 5:08 am I have a question: what exactly does "overlap mode" do?
For example, with the example from the bug report, unless "Occurrences" is set to 60, there is no intersection between the occurrences. With "Overlap Mode", this makes a multi-solid compound out of the transformed "tool shapes". OCC's fuse algorithm doesn't seem to like fusing (at least solids) with compounds. Comp-solids behave correctly, but the fuse somehow always creates a compound.
Right now there are a couple options:
1. Run through each of the solids of the compound: can make everything slow as the last one.
2. Make the fuzzy fuse/cut on the original object itself, but this sounds like doing things exactly as with "Overlap" property set to "No overlap mode" without making a compound. As such the fuzzy operations can be done in parallel, as opposed to serially adding individual transformed tools to compound (though it can be parallelized as well in some way).
Sorry if I'm getting too technical here. Please point out where I'm being too opaque.
The main purpose of the overlap mode is to avoid to run boolean operations inside the for loop when transforming the add/sub shapes. There are the three modes that either force a boolean operation, always add the transformed shape to the compound or automatically detect if a boolean operation is needed or not.
After the for loop the tool shape for the final boolean operation is computed. If overlapping mode is on then the tool shape is performed by a fusion of all transformed shapes and otherwise the compound is kept.
When using the new API (it's not so new any more) of BRepAlgoAPI_BooleanOperation to pass a list of shapes we actually don't need this workaround with the compound any more and could always use just that API.
When doing this with the test file of the first posting of this thread then the issue is fixed. I haven't tested the other projects file so far.
I have uploaded a branch to https://github.com/wwmayer/FreeCAD/tree/issue_6641 that at the moment uses your idea with the compound solid for testing purposes. But because at the end always a boolean operation is performed I think we can remove the if-else check and use the if-branch.
This has also the advantage that the boolean operation that is done to check if the result has two or more solids can be dropped.