set driven key for the opening for sure, smooth bind for a rougher result but you could use softbodies for the folding in some way maybe. what cad software do you use out of interest?