Automatic trajectory generation for thermal spray application is highly desirable for today’s automotive manufacturing. Automatic robot trajectory for free-form surfaces to satisfy the coating uniform is still highly challenging due to the complex geometry of free-form surfaces. The purpose of this study is to present and implement a method for automatic generation of robot trajectory according to the given spray parameters on polygon profile and complex curved free-form surfaces, such as torch speed, spray distance, spray angle, and so on. This software development foundation is an Add-In programme of RobotStudio, which is off-line programming and simulation software of ABB Company. The experimental results show that the robot trajectory can be generated rapidly, accurately, and automatically on the complex geometries by this method.