The length of the string is different in each of these three cases. I think we could probably experiment with boxes (or a drawing) and eventually we could prove that the string is the same length in all 3 cases ONLY IF the box is a cube - all three sides are of equal length.
We would have to prove that:
(2D) + (2W) = (2H) + (2W) = (2H) + (2D)
First we would divide everything by 2 to simplify it the formula. A cube's side must then be consistent with this:
D + W = H + W = H + D
Let's try it with our existing box. If we have sides of 1, 2 and 3, the formula's results give us
2 + 3 = 1 + 3 = 1 + 2
BUT when we solve it, 5 ≠ 4 ≠ 3 This box with unequal lengths doesn't fit the formula.
If we use a cube with each side 2 units long, then the results are like this
2 + 2 = 2 + 2 = 2 + 2 or 4 = 4 = 4
Here's a flattened cube.
And a rotating one.