Movement primitive (MP) is proposed to model the robot skills with the idea of reusing basic behavior units. By learning the demonstrations, the MP can be modeled and utilized to generate similar motions to adapt to slightly changed scenarios. However, many kinds of MP models do not consider the geometric shape constraints and the trajectory execution accuracy, which will bring the shape distortion and contour error when task generalization. Traditional MP models are mainly studied for imitating human-like operating skills and have not been applied in industrial scenarios such as robot machining. In this article, a framework based on the combination of dynamical movement primitives (CDMP) with trajectory segmentation and node mapping methods is proposed to realize the imitation of robot machining motion. The demonstration machining trajectory is segmented first according to the kinematic features, and the shape features are extracted and stored by the node mapping policy. Then, the CDMP model is built for describing a complicated machining motion with many component DMPs. The parameters preferences associated with the model performance of CDMP are analyzed in the simulation. At last, a robot grinding experiment is conducted to show that the proposed framework can successfully imitate the machining motion with low geometric distortion, contour error, and computation cost, which also obtain a good surface quality and can significantly improve the intelligence level of robot machining.