This paper introduces some key technologies in laser path compensation. STL file format is the de facto standard between CAD system and rapid prototyping system. Slicing result of STL file is a set of closed polygons of cross-sectional contours. The cross-sectional contours must be offset a distance inward solid area in the course of machining parts because of the size of laser light spot. A simple calculating method of offset contours is presented. Aiming at self-intersection of offset contour, a modified algorithm of detecting self-intersection points is proposed. The algorithm reduced the time complexity. To eliminate the invalid loops, a uniform method to identify invalid loops is proposed and an effective removing algorithm of invalid loops is presented. The algorithms of this paper not only improve the efficiency of program but also enhance the precision of part.