Extract unaffected Cubes from distorted 3D-Grid

I have created a 3D grid, which gets distorted by three spheres, respectively by the distance to the center of them.

In the next step I want to further subdivide the unaffected cubes and I was able to get the undistorted lines. But I don`t know how to extract the closed wireframes.

Modell07.gh (41.2 KB)