Hinges not folding the right direction

I am trying to get a mesh to fold into this shape


I have gotten it to fold correctly in pieces but cannot get it to work all together. Is there a way to create attraction points to make sure they are going in the right direction or is there a better way to control the hinges themselves. I would love some advice. I’ve attached the definition i have been working with. Capture Capture_1 FOLDING_MESH_2_17.gh (51.4 KB)

foldup.gh (6.3 KB)

For simple folding mechanisms, it can sometimes be easier to avoid hinges altogether, and just enforce length constraints on the edges. Here I’ve shown how you can get this shape by keeping edge lengths, fixing the outer points in the XY plane, pulling the corners of the squares together, and a small vertical pull on the middle points to pop it up into shape.

Thanks! This looks like it could work but its not folding 3 dimensionally, its just moving points on the x,y plane. It looks like some of the points you included aren’t being used but I can’t figure out how to get this one working.

Ah, that’ll be because I saved it from a newer version. Here’s one that should work for you.
I also added a slider for bringing the points together that makes it a bit easier to control. If you start with it at 1, then bring it to 0 once its running it will pull the shape up
foldup2.gh (7.4 KB)

Thanks so much! This is perfect.