Problem of self-shading of blocks

Hi everyone
subject: minimize the hours when the facades are exposed to the sun
i have a problem, i try to generate a set of boxes from top to bottom, my principle of this composition is based on: 1- the principle of shading by neighboring blocks, 2- self-shading: the boxes at the top level shade the boxes located at the bottom level

so my problem is that when i launch the second generation for the bottom level, i see that the shading of the top level is not taken into consideration
i hope i was clear in my explanation
the attached files can give more details

TEST 2 VOXEL.3dm (231.7 KB)
problem of self-shading of blocks.gh (67.9 KB)