As the continuous expansion of robot grinding objects, the traditional manual teaching and offline programming methods can no longer meet people's requirements for grinding trajectories. With the help of a 3D scanner, model data can be acquired quickly and accurately, which facilitates trajectory planning and effective grinding for workpieces. In this paper, a point cloud hole repair method is proposed based on B-spline surface. It integrates point cloud segmentation, feature point removal, smoothing and hole repair, aiming to solve the hole problem in steel helmet scanning. In addition, to generate a uniform grinding trajectory, a planning method is proposed based on an improved B-spline curve. This method combines curve homogenization with equidistant offset and uses k-nearest neighbor search. Iteratively identify and eliminate unreliable point data to determine the best point of contact. The effectiveness of the two methods is verified by trajectory planning on three types of steel helmets.INDEX TERMS Robotic grinding, point cloud processing, holes repairing, trajectory planning, posture optimization.