The design of cam mechanisms and linkages