Grampa Strutts made a similar machine out of wood with tapered wood dowels instead of prism-shaped dogs based upon the 2nd .gif. It’s the basis of a 4-stroke engine. The top one I messed with and added 4-colors only because someone elsewhere complained that B&W didn’t make it.
I love this stuff. I might have to add a category for Trig/Geometry/Math.