Rigid Body Collide

Hi, I am working with curved folding of a structure. The structure consists of three elements that fold simultaneously and from a flat configuration they fold into a curved arch. The only problem is that I need the folding to stop when the side faces of the modules start to coincide, as shown in the pictures. I tried to use RigidBodyCollide but I cant seem to make it work. I attached my gh. file and I grouped in RED the part i am struggling with. Can anyone help me out? @DanielPiker ? Thanks!

02_Multiple arches.gh (62.4 KB)