A twist exponential approach to gear generation with general spatial motions