The STL or Standard Tesselation Language file format arose for the needs of *stereo lithography*. Stereo Lithography is another, slightly more complex 3D printing technique. Because 3D printing only concerns the outside of a file, a STL file only describes the outside faces of the original CAD File.
Formal Information about the STL format can be found[[ http://en.wikipedia.org/wiki/STL_%28file_format%29 | here]].
A formal paper on the subject can be read here:
It will not be necessary to write STL files by hand, but it might be instructive for you to read the inside of one. Some have asked why there needs to be an intermediary STL step, instead of a direct G-Code Translation.
STL files use a relatively simple syntax, that describes the external faces of the file very well.
The file begins with
Hopefully at this point you will have a better idea of the sort of information that is contained inside an STL file. This will help in you deeper understanding of 3D printing.
In most situations this will actually be rendered as
Of course, you could enter a file name here, but it will not change the functionality of the file one bit.
The file is described as a number of triangles. The triangles are described thusly:
facet normal n n n outer loop vertex v1 v1 v1 vertex v2 v2 v2 vertex v3 v3 v3 endloop endfacet
The first line:
facet normal n n n
describes a vector pointing away from the inside of the model.
This second part of the file describes the position of each vertex in space.
vertex v1 v1 v1
At the end of the file we write:
It is important to realize that the exterior of your file is made of a series of very small triangles. This may help you visualize the actual surface of your model.
Because the printer only understands the outer Polygon of the printed file, it is important that the triangles be closed. That is to say, each vertex of the triangle touches no more or less than two other triangles. Certain programs (Meshlab being a good example) will fix this problem for you.
The conversion to STL format from other formats.
While it is beyond the scope of this wiki article to describe the conversion process for every single file format, we will walk you through a prototypical example with Mesh Lab. STL's are converted from file other file formats via a process called tessellation.
To generalize, most 3D files are recorded as either vertices, triangles, or triangle strips. For computers this is most efficient way to notate shapes. However these triangles do not necessarily correlate to the STL format. The STL detects the outside surface of the 3D file and chops that outside surface into thousands of triangles.
If you are curious over how this is done you might want to check out this wikipedia article: