Folding Armature rhino and Grasshopper

I have managed to make this folding armature in grasshopper ( the setup is definitely not clean, but it gets the job done). Now what I wanna do is rig my rhino geometry onto the armature I’ve made and so that the whole geometry folds as the armature. the folding structure has very fixed dimensions and alignments so that it has to be modeled in rhino first.

how do I go about it.