This article will cover everything about the STL file format used in 3D printing. The format will be explained in depth: its history, advantages and shortcomings, the way it works, and the alternative formats available.
STL files store data about the 3D models. An STL file can only contain information about the surface geometry of an object. There’s no data about its color, texture, and other properties. The file extension is “.stl” and the files are usually generated by CAD (computer-aided design) software.
This is the most common file format for 3D printing. Slicer programs can convert the information it stores into the sets of instructions for the hardware of the 3D printer.
The STL file format is supported by the vast majority of CAD programs and 3D editors and is used for a variety of purposes: from 3D printing to rapid prototyping and manufacturing.
It’s considered that STL stands for “Stereolithography” but there are also several backronyms attributed such as “Standard Triangle Language” and “Standard Tessellation Language”.
Tessellation is used to encode the data about the surface geometry of a 3D object.
Tessellation is a tiling of a surface with geometric shapes without gaps and overlaps. Honeycombs and tiled walls are great real-life examples of tessellation.
The shapes used can be simple or complicated. Sometimes even the imaginative ones are used. Examples of tessellations in the art can be found among the works of M. C. Escher.
The first stereolithographic 3D printer was invented in 1987 by Chuck Hall. At the time, The Albert Consulting Group for 3D Systems was figuring out how to transfer the data about the models to the printer. Using tessellation ended up being their choice.
The solution was to tessellate the surface of the models with many small triangles (“facets”) and store this data in files.
For example, for a simple cube 12 triangles would be enough, because one side, being a simple triangle, will require just 2 triangles to cover itself. Things get a bit more complicated with spheres, because the amount of the triangles needed grows significantly.
The tessellated cube.
The tessellated sphere.
And below is the example of a complex tessellated 3D shape:
The Albert Consulting Group for 3D Systems has found out that the data about the triangles can be stored in files and will be enough to describe the model’s surface. And that’s how the foundation for the STL format was born.
In the STL files the two following formats of storing the data are used:
The ASCII method
The binary method
Each of them is able to store these types of information about the triangles/facets:
The coordinates of the triangles’ vertices
The data regarding the normal vector. It should always point outwards related to the model.
This format is easy to read, although takes more space. The files start with the line “solid <name>” with the “name” part being the name of the model (it can easily be left blank). The rest of the file is usually just the coordinates of the facets and the data about the vertices.
This is a more compact version and a more common one, although it’s less readable for humans.
This type of file starts with a header with 80 characters (usually ignored by the file readers), then the 4-byte unsigned integer indicates the number of triangles. The rest is just the information about the triangles, represented as 32-bit floating-point numbers.
The specifications include some rules that must be followed when storing the data
Each triangle must share two vertices with each of its adjacent triangles.
The orientation of the facet must be specified in two ways.
The rule implies a couple of things:
All of this provides the consistency of data and can help to detect the corrupt files, so in this case, the redundancy is justified.
The coordinates of the triangle vertices must all be positive.
This means that the 3D object must exist in the all-positive octant of the 3D Cartesian coordinates system.
This eliminates the need to use signed floating-point numbers, thus there’s no reason to add “+” or “-” signs and in result, allows to save a lot of space.
The triangles should appear in ascending z-value order.
This is not a strict rule per se, but it’s recommended and allows the slicing software to work faster.
Before the printing process begins, the file must be opened in a slicer. The slicer is a piece of software capable of converting the data of the 3D models into a set of instructions that the printer will follow. The slicer creates hundreds or thousands of layers and is able to find out how much material is needed to be extruded. Then the layers are printed.
This kind of information is stored in a G-code file, the format that the printer can ‘read’. Choosing the right slicer is very important because it significantly affects the quality of the prints. After the G-code file is uploaded, the layers are reassembled in a 3D object on the print bed by extruding the materials in a succession on a layer-by-layer basis.
You can’t print the model that isn’t specifically made for it. There are various things required: wall thickness being bigger than zero and the surface being watertight.
If there are overhangs present, the model will require support structures while printing.
It’s highly recommended to verify the STL files downloaded online for printability if your plan is to print them.
The surface of a model is never perfectly approximated with the facets in case of complex shapes. The 3D printer produces this object with the same coarseness as the STL files data provides. Everything can be made better and smoother if the size of a triangle is reduced. But this also results in the amount of the facets being bigger. A good quality print can have hundreds and thousands of facets, which will lead to the size of the STL file being disproportionately large. These huge files take a lot of space, are not easy to share and upload, and many 3D printers just can’t handle them.
So striking the right balance between the quality of the model and the file size is extremely important. For example, at one point your eye will be unable to distinguish the print quality and then the optimization is going to head straight into the ‘diminishing returns’ territory. So after a certain point increasing the number of facets stops making sense.
You can control the size of the facets using different settings provided by the majority of CAD programs. Here we will cover the most important of them.
Chord height or tolerance is an important parameter that means the maximum distance from the original surface to the mesh/tile saved in the STL file. The smaller it is, the more accurate the original design is represented, and the smoother the surface will look. The recommended value is between 0.01 and 0.001 millimeters. Setting a lower number isn’t needed, since the majority of the 3D printers are unable to work with such accuracy.
This means the limit of the angle between the normals of adjacent triangles. The default is 15 degrees and the value ranges between 0 and 1. The lower — the better, and the recommended value is 0.
For printing the binary format must be chosen, but if you’re planning to read the file yourself, export in the ASCII format, since it’s significantly easier to understand.
There are various file formats used in 3D printing, even though the STL is probably the most common one. For example, the OBJ format is able to save color and texture data. There’s also the PLY format.
Recently The 3MF Consortium has been proposing a new format called 3MF. Many companies including Autodesk, HP, and Microsoft have united in attempts to popularize this format and to standardize it. But it’s early to say anything about the format and whether it will be widely adopted.
The answer, of course, will depend on your use case.
As an example, if you want to use multiple colors and/or materials when printing, then the STL is not your choice since the files can’t store data about anything other than the facets and vectors of the surface. The preferred format would be the OBJ, since it’s not only common and well-supported, but also can save the information about the color and material of the object.
On the other hand, if you need to do a simple print with a single material and color, then the STL is a great choice — the files are lightweight, supported by nearly every 3D printer on the market, and are quick to work with due to smaller size.
Universal support. Almost every 3D printer available on the market supports the STL format. The same cannot be said about other file formats, although the OBJ has been steadily gaining popularity.
Grown and mature ecosystem. The vast majority of printable models found online are available in the STL format. The ecosystem is large and keeps growing. There are third-party programs available on the market that allow repairing, editing and slicing STL files and the amount of them is larger than for any other format.
Large file sizes for high-quality prints. The accuracy and fidelity of the modern 3D printers keep becoming more precise. For impressively smooth surfaces of complex curved objects, the amounts of the required facets are constantly growing. The sizes of the STL files required for such accuracy will be massive.
Lack of stored data. While the STL’s inability to store the information about color and materials has been mentioned before in this article, the other types of data can’t be stored in the STL format as well. The metadata covering ownership and copyright can’t be included, so some will find it to be a really big disadvantage.
The STL files can’t work with multi-color and multi-material printing. There’s a reason to that — the file format is rather old, first appearing in the 1980s, when no one expected the color printing to become possible quite soon. The evolution of prototyping, 3D technologies, and printing has since allowed using different materials and colors.
But we must mention, that even though the standard STL can’t handle multi-color printing, there exist non-standard versions of this file format, that allow STL to store data about colors. There are different ways to do so:
VisCAM and Solidview programs apply 15-but RGB color to the information about every triangle using different bits for different channels of the scheme.
The Material Magic software uses the 80-byte header at the beginning of the file to store the data about the color of the 3D model. It uses the “COLOR=” string of the ASCII format and four bytes that represent the color and transparency channels
There’s a nearly infinite amount of resources where you can download STL files for free or for cheap. Just some of them:
Thingiverse — perhaps the most popular resource for free 3D models.
MyMiniFactory — a large marketplace full of free and paid 3D files
Free3D — a repository with thousands of free and paid 3D models
Pinshape — a huge marketplace of thousands 3D models and designs
There are many online tools and offline software that allow you to view STL files.
Microsoft 3D viewer — a pre-installed software for Windows. It’s simple and can also open various other formats: OBJ, FBX, 3MF, PLY.
ViewSTL — a simple online tool that allows you to view STL and OBJ files by drag-and-dropping them or browsing your directories.
GLC-player — a free and open-source cross-platform (Windows, Linux and macOS) solution that allows you to open OBJ and STL files.
The STL is an open format, so you’re completely allowed to edit it or convert it into another format. Due to STL popularity, the amount of editors is very big, ranging from simple programs to full-blown 3D editing solutions. Here are some of them:
Blender — it’s free and open-source, available for Windows, macOS and Linux and is likely the most popular solution among free 3D editing programs. It boasts impressive functionality and is a program of choice of many professionals and hobbyists alike.
FreeCAD — another free, open-source and cross-platform program. It has some problems with intercepting structures and might not be the most user-friendly software out there, but it’s a worthy contender if you’re looking for a free and powerful 3D editor.
SketchUP — a very popular paid (but there is a free version available) 3D editing tool.
This article has already covered several rules regarding the STL files. Those might be easily violated, resulting in a corrupt file or a broken print. Luckily, there are many programs on the market that offer functionality dedicated to fixing those ‘mistakes’. This is called ‘STL repair’. These programs are also usually able to either edit STLs or work as slicers, with the repairing functionality being rather a bonus.
Netfabb — this STL edit and repair solution developed by Autodesk is paid (but free for students), powerful and widely adopted.
Meshmixer is another popular solution. It’s free, available for Windows and Mac and offers great functionality. It’s also good for editing STL files.
This article covered many different points. From the history of the STL file format and birth of its main concept to the way it stores data, from the limitations of STL to various programs that help working with these files. We have even discussed the alternative file formats and the resources for getting free 3D models