In the present paper a computer-aided procedure for optimum design and NC milling of cam mechanisms is introduced. In the first part of the paper a non-linear programming optimization technique, to design a cam mechanism with optimum transfer functions and minimum dimensions, is presented. Furthermore, considering the interpolation facilities of the available NC milling machine, a procedure to generate the cam NC-code, enabling the achievement of the desired cam accuracy and of the permitted transfer functions deviations, is introduced. This procedure also leads to a significant reduction of the NC code size. An application of the developed CAD-CAM system is demonstrated. Cams, designed and manufactured with the aid of the presented procedure, are tested by measuring the follower acceleration and comparing it with the theoretical one. (C) 1997 Published by Elsevier Science Ltd. All rights reserved.