Input: block of gear and pulley (in pink) that can change its rotary direction.
Output: blue shaft that rotates and translates. For each revolution it translates S mm.
S = (1 – (Z1Z3)/(Z2Z4))*L
Z1, Z2, Z3, Z4 are tooth numbers of pink, large green, small green and violet gears respectively.
L: lead of helical joint (blue screw and violet nut) in mm.
In this video Z1 = Z3 = 25; Z2 = Z4 = 50; S = 0.75L
The blue shaft has prizmatic joint with the pink block (orange keys).
Alter the tooth numbers for desired S.
The mechanism can be applied for thead cutting.