Minimal blocking objects with shadows like a cube

Lower bound:

Let there be $c$ cubes in a blocking configuration. Consider the graph whose vertices are cubes so that cubes are connected if they share a face. Any connected graph has at least $c-1$ edges. By the pigeonhole principle, there is at least one direction with at least $(c-1)/d$ edges in that direction. When you project parallel to that axis, the image has size $n^{d-1}$, and the size of the image is also at most $c - (c-1)/d$ since at least one vertex on each of those edges is redundant. So,

$$ n^{d-1} \le c - \frac{c-1}{d} = c \frac{d-1}{d} + \frac 1d$$

$$ c \ge \bigg(\frac {d}{d-1}\bigg)n^{d-1} - \frac {1}{d-1}. $$

For $d=3$, $c \ge \frac 32 n^2 - \frac12$ (mentioned by Gjergji Zaimi in the comments). This is sharp for $n=3$ by the construction with $13$ cubes shown by Joel David Hamkins.

Upper bound ($d=3$):

Here is a construction of a connected blocking configuration with $\frac32n^2 + O(n)$ cubes related to Zack Wolske's constructions. We'll identify the cubes with lattice points. We start with the points $\lbrace(x,y,z) | x-y \equiv z \mod n, 0 \le x,y,z \lt n \rbrace$, illustrated for $n=7$.

|......X|  |x......|  |.x.....|  |..x....|  |...x...|  |....x..|  |.....x.|
|.....X.|  |......X|  |x......|  |.x.....|  |..x....|  |...x...|  |....x..|
|....X..|  |.....X.|  |......X|  |x......|  |.x.....|  |..x....|  |...x...|
|...X...|  |....X..|  |.....X.|  |......X|  |x......|  |.x.....|  |..x....|
|..X....|  |...X...|  |....X..|  |.....X.|  |......X|  |x......|  |.x.....|
|.X.....|  |..X....|  |...X...|  |....X..|  |.....X.|  |......X|  |x......|
|X......|  |.X.....|  |..X....|  |...X...|  |....X..|  |.....X.|  |......X|

This is made of two triangles of points, in the planes $x-y=z$ (marked X) and $x-y=z-n$ (marked x), which are separated by some distance. We'll first make the connections within the triangles, and then connect the triangles to each other.

To connect the bottom triangle, use $n-1$ extra points (marked A) to connect the base of the triangle in the plane $z=0$ to itself and to the points in the triangle with $z=1$. Then for $i = 2, ..., n-1$, use $\lceil (n-i-1)/2 \rceil$ points (marked O) to connect the points in the plane $z=i$ to each other and to the lower points in the triangle. These points have $y$ odd, and are just above an X in the layer below.

|......X|  |x......|  |.x.....|  |..x....|  |...x...|  |....x..|  |.....x.|
|.....XA|  |......X|  |x.....O|  |.x.....|  |..x....|  |...x...|  |....x..|
|....XA.|  |.....X.|  |......X|  |x......|  |.x.....|  |..x....|  |...x...|
|...XA..|  |....X..|  |....OX.|  |.....OX|  |x.....O|  |.x.....|  |..x....|
|..XA...|  |...X...|  |....X..|  |.....X.|  |......X|  |x......|  |.x.....|
|.XA....|  |..X....|  |..OX...|  |...OX..|  |....OX.|  |.....OX|  |x.....O|
|XA.....|  |.X.....|  |..X....|  |...X...|  |....X..|  |.....X.|  |......X|

This has added $n-1$ A's (this is one of the few correct uses of apostrophes to indicate a plural), and $0+1+1+2+2+...+\lfloor (n-1)/2 \rfloor = \lfloor (n-1)^2/4 \rfloor$ O's (see A002620).

We repeat the process upside down to connect the upper left triangle using $n-2$ A's and $\lfloor (n-2)^2/4 \rfloor$ O's.

|......X|  |x......|  |.x.....|  |..x....|  |...x...|  |....x..|  |....Ax.|
|.....XA|  |O.....X|  |xO....O|  |.xO....|  |..xO...|  |...x...|  |...Ax..|
|....XA.|  |.....X.|  |......X|  |x......|  |.x.....|  |..x....|  |..Ax...|
|...XA..|  |....X..|  |....OX.|  |O....OX|  |xO....O|  |.x.....|  |.Ax....|
|..XA...|  |...X...|  |....X..|  |.....X.|  |......X|  |x......|  |Ax.....|
|.XA....|  |..X....|  |..OX...|  |...OX..|  |....OX.|  |.....OX|  |x.....O|
|XA.....|  |.X.....|  |..X....|  |...X...|  |....X..|  |.....X.|  |......X|

Finally, we connect the upper and lower triangles with $n-2$ Z's. There are many choices for how to do this. We'll put them in $z=1$, $y=n-2$, $1 \le x \le n-2$.

|......X|  |x......|  |.x.....|  |..x....|  |...x...|  |....x..|  |....Ax.|
|.....XA|  |OZZZZZX|  |xO....O|  |.xO....|  |..xO...|  |...x...|  |...Ax..|
|....XA.|  |.....X.|  |......X|  |x......|  |.x.....|  |..x....|  |..Ax...|
|...XA..|  |....X..|  |....OX.|  |O....OX|  |xO....O|  |.x.....|  |.Ax....|
|..XA...|  |...X...|  |....X..|  |.....X.|  |......X|  |x......|  |Ax.....|
|.XA....|  |..X....|  |..OX...|  |...OX..|  |....OX.|  |.....OX|  |x.....O|
|XA.....|  |.X.....|  |..X....|  |...X...|  |....X..|  |.....X.|  |......X|

In total, this configuration contains $n^2$ X's, $2n-3$ A's, $n-2$ Z's, and $\lfloor (n-1)^2/4\rfloor +\lfloor(n-2)^2/4 \rfloor = {n-1 \choose 2}$ O's, a total of $\frac 32 n^2 + \frac 32 n - 4$.

Therefore,

$$ \frac 32 n^2 - \frac 12 \le \min |C_3(n)| \le \frac 32 n^2 + \frac 32 n - 4.$$


For the main case ($3\times 3\times 3$), here is a solution using 13 blocks:

 1 1 0   0 0 1   0 0 1 
 0 1 0   1 1 1   0 1 0
 0 1 1   1 0 0   1 0 0


Update: For the $4\times 4\times 4$ case, here is a solution using only 24 blocks, which is optimal according to the $\frac{3}{2}n^2-\frac 12$ lower bound provided by Douglas and Gjergji.

  0 1 1 1
  0 1 0 0
  1 1 0 0
  1 0 0 0

  1 0 0 0
  1 1 1 1
  0 0 1 0
  0 0 1 0

  1 0 0 0
  0 1 0 0
  0 0 0 1
  0 1 1 0

  1 0 0 0
  0 1 0 0
  0 0 0 1
  0 0 1 1


(Click on the edit history for my previous solutions, which used first 27 blocks, then 26, then 25, and now 24.)


Edited image to correct an error, as per Michael Biro's comment

Here are a few small cases which can each be done with $\frac{3}{2}(n^2+n) - 5$ blocks. They're built by placing $n^2$ "X" blocks to give the correct shadows, then placing $\frac{n^2+n}{2} - 3$ "O" blocks to connect each "X" block to one of two components, and finally $n-2$ "Z" blocks to put the components together. The third example places the "Z" blocks in a funny way to indicate that there are many options available. They could just as easily have been placed in the second column of the second layer, like they were in the $n=4$ case.

Not sure if this will be helpful to you, because I don't have an argument that you can do this for every $n$, but the placement of "O" blocks seems to just repeat the previous levels (a similar arrangement works for n=7 just by copying the "above/below diagonal" positions from n=5) and you can certainly show that $n-2$ "Z" blocks will suffice to connect the two components, since there are many paths of length $n-1$ between "X" diagonals within a layer, and you only need a single "O" on any one of them. Maybe someone can extract an algorithm from this and make it precise. The OEIS didn't give any results for "1,3,13,25" where the next number was at most 40, so maybe 25 is not the best, or maybe it's not known.