Solid Difference Occasionally Creates Invalid Breps

I am creating a script that generates nodes for a frame structure. I am solid differencing the frame pieces out of the nodes, which works well for 99% of my nodes. However, on 1 or 2 nodes the SDiff will create an invalid Brep, even though the node is very similar to many others that were successfully created. Is there any way to fix these invalid breps such that I can bake them? I have attached a selection of my file that generates the issue. Thank you for your help!


Frame Nodes (7.5 MB)

The inner crosses you are trying to boolean, which consist of 4 bars, shows some nasty intersections where they meet, and this is causing the trouble I suspect. I’d recommend to construct a cross that aligns with your nodes and boolean that out instead. In general I try to avoid booleans as much as possible because they are slow, but I also realize that in this case they are hard to avoid.

You can drastically improve Boolean solids if you limit their interaction to only the relevant pieces, which is what the white group does. It uses Brep CP (Brep Closest Point) to find only the geometry that is close to each node center point.

SInt fails on one intersection so I added Combine to substitute the node brep before it gets rounded.

By the way, I avoided Loft because I thought Extrude was more appropriate in this case. (purple group). I tried creating the spheres instead of using the internalized but it didn’t help.

Frame (7.5 MB)

P.S. If you disable preview on the connecting geometry (‘FRAME PIECES’ and ‘NEGATIVE SPACE’), you see two of these, not sure why:

Using the spheres as nodes doesn’t help much, neither does center boxes.

P.P.S. Further examination shows that 3 of the 73 nodes don’t bake at all and others are missing some SDiff cuts. Wait, there are only 56 curves and nodes!? Something is still amiss, I would suspect the connecting geometry first.