World Position Cylinder Mask

Hi,
I want to do something like World Position with a Sphere mask to have objects dissappear when they leave the space but it needs to be strictly cylindrical shaped - a cylinder with flat ends. And be able to use different shapes - pyramid, hexgonal etc.

Have looked at previous questions asked on this but no-one seemed to have answered it without a cheat of some kind. Looking for a strict cylinder mask here in particular

Thanks!