Problem:. Based on the list of spheres, find all the empty spaces completely covered by the spheres.
Details: This is the problem I'm working on, in which I am trying to identify the cavities located in the protein. I am given a list of atoms that make up the coordinates of the protein ((x, y, z) and radius). Then I run my algorithm to find all the empty spaces that lie within the boundaries of the protein, checking whether it is possible to place the probe (of a given radius) in place without colliding with other areas. There are two types of empty spaces, voids, and cavities. Hollow spaces are spaces that can lead to or outside of the protein. Cavities are empty spaces that are completely covered by protein atoms. Here is an image of the protein sample we are working with.

It can be viewed in three dimensions here .
There is a cavity located near the center of the protein, the tunnel that you see through the protein will be considered a void space, because it is not completely closed by atoms.
Example:. Given a list of 26 atoms, these atoms are evenly distributed from (0,0,0) to (1,1,1) in a three-dimensional grid. Each atom has a radius of 0.25 and is placed either on 0, 0.5, or on any axis. At the point there is no atom (0.5, 0.5, 0.5). If we drew a three-dimensional figure of these atoms, it would be a cubic shape with a missing center. A cavity would be designated in (0,5,0,5,0,5) with a radius of 0.25. It can be assumed that this cavity is surrounded by proteins on all sides.
Image example: 
Note that the above is only a two-dimensional representation of a cube and a protein. This is actually 3D.
How could one define void spaces against cavities for a much larger and irregularly shaped group of atoms?
I was thinking of implementing a recursive algorithm that checks every direction to see if it can reach the maximum and minimum boundaries of the chart, but I'm not sure if this is the right way to do this.
Additionally: Is there another algorithm that says that the cavity in the example is actually a void space, because there are very small “paths” for reaching the protein outside? The cavity must be completely closed by atoms for existence. Any void spaces that have a path (in any direction, not necessarily straight) to the outside of the protein will not be considered cavities.