Visual guidance technology advances quickly and so do the technical requirements for weld trajectory, which needs to fulfill performance indices for high precision, anti-interference and quick processing. In this study, the approach of getting 3D point cloud data by directly scanning the workpiece to be welded with a 3D scanner is used because it is more precise and reliable than processing gray-layer data obtained from a depth camera, turning it into a 3D point cloud. The weld boundary is retrieved by slope calculation for the butt weld after preprocessing the three-dimensional point cloud data (cut, down-sampling, and abnormal value removal). The center point is then determined. After that, a welding trajectory is produced by fitting the center point, which is transmitted back to the actuator to guide its welding work and realize the identification and tracking of the weld.