This is the top view of a kind of folding box, actually a henhouse.
The goal is to meet those three requirements:
totally foldable when not in use, as flat as possible so that it's easy to move and store.
a free standing position when a wall is not available (area=100)
an against the wall position when it's possible to use an existing wall.
Each panel would be a light frame with chicken wire attached on it.
How can I solve the problem with the second hinge. It needs to somehow rotate in both directions. I don't see how this could be solved with permanently attached hinges.