This one is kind of hard to explain, so please bear with me! Due to a very complex job (too hard / lengthy to explain!) I'm trying to set up, I could really do with what is essentially a portal gun in Illustrator!
I've attached some images to try and get my point across! Basically, when the object (a green triangle) is below line A, nothing protrudes from line B.
When the object moves up beyond line A, the section that went past line A protrudes out beyond line B, rotated. If the object moves left and right under line A, it would move down and up when coming out from line B.
To make things even more complex, ideally there would be more than one 'portal' - but if at least one were possible, it would make this job much more achievable!