Problems with BRepAlgoAPI_Fuse when uniting multiple bodies


I have OCCT 7.5.0 on my MacOS Big Sur, installed using homebrew. I am trying to generate a solid in STEP format made up of cylinders and spheres using an app based on OCCT. Pic of the desired solid (Pic 1) is below:

1. It has 4 primitive cylinders arranged at 4 body diagonals of a cube.
2. A small sphere at the center of the cube (also where all cylinders intersect).
3. All cylinders in 1 and sphere at 2 are to be united to generate a single solid.

1 and 2 and created using BRepPrimAPI_MakeCylinder and BRepPrimAPI_MakeSphere

I am having issues when I try to perform step 3 - uniting all primitives. All methods resulted in a failed union. I verified the union by writing it as a STEP file using STEPControl_Writer and opening in it in a 3D CAD software FreeCAD. The result appeared nonsensical or gibberish with missing cylinders, open or partial solids .
I have tried multiple ways to unite by specifying TopTools_ListOfShape arguments and TopTools_ListOfShape tools Here are the different options that didn't work and I have tried:

List of Shape(s) for arguments List of Shape(s) for tools
1 Cylinder 3 Cylinders
1 Sphere All Cylinders
1 Cylinder 3 Cylinders and 1 Sphere

After this, I thought maybe it's the intersection of all cylinders before union, that might be causing the problem. So I split my cylinders in halves such that any half doesn't touch any other half. If all of these half cylinders are taken a union with an overlapping sphere at the center, then the resulting solid will be the same as what I want to generate, as shown in the Pic 1 above.
pic of the half cylinders here

pic of the desired solid with sphere

List of Shape(s) for arguments List of Shape(s) for tools
1 Sphere All Cylinders halves
All cylinder halves 1 Sphere

In all trials, I got bad results, one of the examples:
bad union

Apart from using list of arguments and tools, I also tried to unite cylinders iteratively and even that was behaving in a very funny way, it will need another post to explain the behavior.

Could you please suggest what if this is an OCCT bug or there is something else that I can try to fix this union issue for this case?

Archak Goel's picture

Hi Tech team. Please let me know if you'd like me to post a smaller version of this post with just basic details. If possible, please comment about, what details will be helpful for you to understand the problem better.

Mikhail Sazonov's picture

Hi Archak,

None of the links in your message are working.

If Boolean operation does not work as expected then please register a bug in the bugtracker.



Eugene Zaliznyak's picture

Hi Archak, please send me your primitives and I will test the union operation on my side.
With respects, Eugene.

Archak Goel's picture

Hi @Eugene Zliznyak, I have uploaded two zip folders containing separate primitives and their union (incorrect) for the two cases: 1. Using full cylinders 2. Using half cylinders.

@Mikhail Sazonov I have also corrected the links to the pictures above. I was using Google Photos shared links earlier, I have changed it to imgur links and tested them, they are working fine.

Archak Goel's picture

Hi OCCT team, did you get a chance to look at this yet?

Mikhail Sazonov's picture

Hi Archak, please create a bug in the bug tracker. It will be processed according to established priorities.