It is a solution for an YouTuber request: tracing an eight-shaped line with constant velocity.
Pin rack consists of grey stationary part and blue moving part. Its pin number: Zr.
Input: orange shaft that is connected to pink pinion of Zp teeth via a double Cardan universal joint. Its velocity: Vp.
A point on the pinion axis draws the required line (in pink).
One working period corresponds N revolutions of the pinion.
N = Zr / Zp
Motion of the blue part is controlled by violet cam that rotates at velocity Vc.
Vc = Vp / N
Device for preventing the pinion from axial displacement is not shown.
Spring device to force the blue part towards the cam is not shown.
Device for motion transmission from the input shaft to the cam is not shown.
There is considerable necessary backlash because the pinion has to engage with the rack on both sides of the rack.