Abstract:A new direct slicing algorithm based on STL model in rapid prototyping was proposed. The binary STL model information was read and the triangular facet matrix was created; the binary search algorithm was used to achieve the intersection and grouping of triangular facets and slice planes; then, for each set of triangular facets and intersecting slice planes, the intersection point was calculated to obtain intersecting line segments, redundant nodes between intersecting line segments were removed; finally, a depthfirst search algorithm was used to optimize the creation of the contour line path for intersecting line segments in the slice plane. In this algorithm, the judgment of the positional relationship between the slice plane and the triangular facet is avoided and the topological information relationship between the triangular facets is established. It has obvious advantages in the slicing timeconsuming.