I am using Mathematica 22.214.171.124, on a Mac.
I have a list of 51 non-intersecting balls of radius 1. The total volume is easily computed exactly, $51\times 4\pi/3 \approx 213.6283004441$.
Now suppose I put the centers of the spheres in a file (attached,
sphere.txt), and then I do this:
spheres = Import[NotebookDirectory <> "/spheres.txt", "Table"] RegionMeasure[RegionUnion @@ (Ball[#, 1] & /@ spheres)]
The answer I get
202.068, has an error of 6%.
I need to compute region volumes of more complicated region unions that might overlap, but this result is discouraging. Is there a way to improve this result?
The example file
spheres.txt can be downloaded from here. Note that the balls are touching at the surface, but the volume of the intersection between any pair is zero.