Rotary on not round or cylindrical items

I did a similar thing with a turn table, just for fun. The only thing you would need to change is the orientation of that axis. I have a short demonstration here:

There is also a link to a more elaborate description. So you could design it to have the rotary as z-axis and do 90° turns every step.
But you can’t change the design per side using this method, it would repeat the same design on each side.