PurposeThe purpose of this paper is to propose an automatic interpolation algorithm for robot spraying trajectories based on cubic Non-Uniform Rational B-Splines (NURBS) curves, to solve the problem of sparse and incomplete trajectory points of the head and heel of the shoe sole when extracting robot motion trajectories using structured-light 3D cameras and to ensure the robot joints move smoothly, so as to achieve a good effect of automatic spraying of the shoe sole with a 7-degree-of-freedom (DOF) robot.Design/methodology/approachFirstly, the original shoe sole edge trajectory position points acquired by the 3D camera are fitted with NURBS curves. Then, the velocity constraint at the local maximum of the trajectory curvature is used as the reference for curve segmentation and S-shaped acceleration and deceleration planning. Immediately, real-time interpolation is performed in the time domain to obtain the position and orientation of each point of the robot motion trajectory. Finally, the inverse kinematics of the anthropomorphic motion of the 7-DOF robot arm is used to obtain the joint motion trajectory.FindingsThe simulation and experiment prove that the shoe sole spraying trajectory is complete, the spraying effect is good and the robot joint movement is smooth, which show that the algorithm is feasible.Originality/valueThis study is of good practical value for improving the quality of automated shoe sole spraying, and it has wide applicability for different shoe sole shapes.