Anybody knows how to calculate perfect fit for closed loop spur gear ?

The gears are module 1, and the cord length between the teeth is equal to PI (3,14mm) . 

SolidworksAssemblies