Based on exist algorithm for STL model slicing. We proposed an algorithm that is based on STL model coordinate layering. When loading STL model, the algorithm layers the model according to the apex coordinate Z of each triangular facets. then calculate intersections according to the topologic relationship among interval edges and apexes of triangular facets in layers. Produce CLI files for rapid prototyping. The method optimized data frame and improved efficiency of slicing.