Hello. I am dealing with unpleasant problem and I would like to ask people for help.

I work on script that makes joints without boolean operations (because of computational time). The outcome consists of cylinders and sphere. The joint looks like this:

I calculate arcs, where cylinder cuts sphere. And the goal is to cut spere to get only residual surface, which is not affected by any cylinder. I was not able to find computationaly fast solution to achieve that.

My approach so far:

- split sphere with curves
- measure distance of each cylinder centroid and all fragments
- get distances equal or larger than cylinder radius
- get rid of all fragments that are located closer than radius

My problem is rounding. Borders of fragments are somehow approximated and I am not able to set the threshold properly, so I sometimes filter out wrong frafments (on both sides). I try to use "similarity"component to get any closer to good result, but sometimes there are little fragments that ruin this approach completely (in uploaded code, itās branch {32}.

I found out that the biggest issue is āstitchā of sphere surface.

So I politely ask for help or some hints that would help me solve this problem. I bet there is a way how to do this better. Would you be so glad to look at my script, please?

splitting spheres problem.gh (74.2 KB)