STL Stereolithography 3D Mesh File Description
The Stereolithography 3D Mesh STL file format is used primarily for 3D printing, prototyping, and computer-aided manufacturing. An STL file is a triangular representation of a 3-dimensional surface geometry. The surface is broken down into small triangles or facets. Each facet is described by the triangle's vertices and unit normal vector.
The STL file format does not contain any scale or unit information. STL files can be saved in ASCII or binary format.
STL ASCII Format
The ASCII format can be viewed in any text editor software. However, ASCII format STL files are considerably larger than binary STL files. The following block is an example of the format structure:
facet normal i j k
vertex x 1 y 1 z 1
vertex x 2 y 2 z 2
vertex x 3 y 3 z 3
Each facet is described by the unit normal vector (i,j,k) and each vertex is described by its coordinates (x,y,z) between the solid and endsolid lines. The numerical data (i,j,k and x,y,z) are single precision floating point values.
STL Binary Format
The binary format is significantly more compact than the ASCII format. The binary format includes an 80-byte ASCII header, an integer value indicating the number of facets, and then a series values describing the unit normal vector, facet vertices, and attribute value for each facet.
See StereoLithography Interface Specification, 3D Systems, Inc., October 1989 for more information on the STL file format specifications.