Spatial Ratchet Mechanism

This is used for case when the input linear motion is parallel to rotary axis of the ratchet wheel.
Input: blue slider linearly reciprocating. Its source motion is not shown.
Output: green ratchet wheel (a helical gear) interruptedly rotating of angle A (360/Z deg.).
Z is the gear tooth number.
A can be increased (2,3, … times) by making the gear longer and increasing input stroke.
Violet spring pin keeps the output immobile during backward stroke of the blue slider.