Total length of a set with the same projections as a square
This problem has been heavily studied. For example, this paper
Dumitrescu, Adrian, and Minghui Jiang. "The opaque square." In Proceedings of the 13th Annual Symposium on Computational Geometry, p. 529. ACM, 2014. ACM link. Preliminary PDF.
includes an analog of your figure:
Dumitrescu-Jiang Fig.1 (detail).
and recites the history of the problem. One of their main results is:
Theorem 2. The length of any interior finite segment barrier for a unit square is at least $2 + 10^{−5}$.
This accords with @alesia's post.
Total length $2$ is not possible.
By integral geometry, total length $2$ is equivalent to the fact that almost every line intersecting the square intersects the union of segments $S$ exactly once. But this would mean that for almost any point $p$ in $S$, the supporting line of any segment in $S$ passes through $p$. Which is only possible if $S$ is included in a line, which contradicts the fact that $S$ intersects all lines meeting the square.