Kangaroo Rack and Pinion

I’m trying to wrap my head around kangaroo collisions and I’m just not getting it. I’m trying to calculate the travel on a rack when the pinion gear turns. I’d like to use the angle slider in grasshopper to drive a simulation. Any direction on how to do this would be really appreciated.

GearTest.gh (4.6 KB)
GearTest-Example.3dm (51.4 KB)