Cam motion synthesis using spline functions