STL (File Format)
STL (File Format)
STL (File Format)
ASCII STL
An ASCII STL file begins with the line
solid name
where name is an optional string (though if name is omitted there must still be a space after solid). The file continues with any
number of triangles, each represented as follows:
facet normal ni n j nk
outer loop
vertex v1x v1y v1z
vertex v2x v2y v2z
vertex v3x v3y v3z
endloop
endfacet
where each n or v is a floating-point number in sign-mantissa-"e"-sign-exponent format, e.g., "2.648000e-002". The file concludes
with
endsolid name
The structure of the format suggests that other possibilities exist (e.g., facets with
more than one "loop", or loops with more than three vertices). In practice, however, 3D
all facets are simple triangles.
White space (spaces, tabs, newlines) may be used anywhere in the file except within
numbers or words. The spaces between "facet" and "normal" and between "outer"
and "loop" are required.[6]
Each triangle is described by twelve 32-bit floating-point numbers: three for the normal and then three for the X/Y/Z coordinate of
each vertex – just as with the ASCII version of STL. After these follows a 2-byte ("short") unsigned integer that is the "attribute byte
[6]
count" – in the standard format, this should be zero because most software does not understand anything else.
Floating-point numbers are represented asIEEE floating-point numbers and are assumed to belittle-endian, although this is not stated
in documentation.
UINT8[80] – Header
UINT32 – Number of triangles
foreach triangle
REAL32[3] – Normal vector
REAL32[3] – Vertex 1
REAL32[3] – Vertex 2
REAL32[3] – Vertex 3
UINT16 – Attribute byte count
end
The VisCAM and SolidView software packages use the two "attribute byte count" bytes at the end of every triangle to
store a 15-bit RGB color:
The red/green/blue ordering within those two bytes is reversed in these two approaches – so while these formats could easily have
been compatible, the reversal of the order of the colors means that they are not – and worse still, a generic STL file reader cannot
automatically distinguish between them. There is also no way to have facets be selectively transparent because there is no per-facet
alpha value – although in the context of current rapid prototyping machinery
, this is not important.
Use in 3D printing
3D printers are stereolithography machines that can build any volume shape as a series of slices. Ultimately these machines require a
series of closed 2D contours that are filled in with solidified material as the layers are fused together. A natural file format for such a
machine would be a series of closed polygons corresponding to different Z-values. However, since it is possible to vary the layer
thicknesses for a faster though less precise build, it was easier to define the model to be built as a closed
polyhedron that can be sliced
at the necessary horizontal levels.
The STL file format appears capable of defining a polyhedron with any polygonal facet, but in practice it is only ever used for
triangles, which means that much of the syntax of the ASCII protocol is superfluous.
To properly form a 3D volume, the surface represented by any STL files must be closed and connected, where every edge is part of
exactly two triangles, and not self-intersecting. Since the STL syntax does not enforce this property, it can be ignored for applications
where the closedness does not matter. The closedness only matters insofar as the software that slices the triangles requires it to ensure
that the resulting 2D polygons are closed. Sometimes such software can be written to clean up small discrepancies by moving
vertices that are close together so that they coincide. The results are not predictable, but it is often suf
ficient.
Many computer-aided manufacturing systems require triangulated models. STL format is not the most memory- and computationally
efficient method for transferring this data, but STL is often used to import the triangulated geometry into the CAM system. The
format is commonly available, so the CAM system will use it. In order to use the data, the CAM system may have to reconstruct the
connectivity.
STL can also be used for interchanging data between CAD/CAM systems and
computational environments such asMathematica. 3D
History
STL was invented by the Albert Consulting Group for 3D Systems in 1987.[8]
The format was developed for 3D Systems' first commercial 3D printers. Since
its initial release, the format remained relatively unchanged for 22 years. In
[9][10]
2009, an update to the format, dubbed STL 2.0, was proposed.
References
1. StereoLithography Interface Specification, 3D Systems, Inc., July 1988
2. StereoLithography Interface Specification, 3D Systems, Inc., October 1989
3. SLC File Specification, 3D Systems, Inc., 1994
4. Grimm, Todd (2004), User's Guide to Rapid Prototyping(https://books.google.com/books?id=o2B7OmABPNUC&pg=
PA55&lpg=PA55&f=false), Society of Manufacturing Engineers, p. 55, ISBN 0-87263-697-6. Many names are used
for the format: for example, "standard triangle language", "stereolithography language", and "stereolithography
tesselation language". Page 55 states, C " huck Hull, the inventor of stereolithography and 3D Systems' founder
,
reports that the file extension is for stereolithography."
5. Chua, C. K; Leong, K. F.; Lim, C. S. (2003), Rapid Prototyping: Principles and Applications(2nd ed.), World Scientific
Publishing Co, ISBN 981-238-117-1 Chapter 6, Rapid Prototyping Formats. Page 237, "The STL (ST eroLithography)
file, as the de facto standard, has been used in many, if not all, rapid prototyping systems." Section 6.2 STL File
Problems. Section 6.4 STL File Repair.
6. Burns, Marshall (1993).Automated Fabrication. Prentice Hall. ISBN 978-0-13-119462-5.
7. Fabbers.com, The StL Format: Standard Data Format for Fabbers, reprinted from Marshall Burns, Automated
Fabrication, http://www.ennex.com/~fabbers/StL.aspstating, "The object represented must be located in the all-
positive octant. In other words, all vertex coordinates must be positive-definite (nonnegative and nonzero) numbers.
The StL file does not contain any scale information; the coordinates are in arbitrary units."
8. "STL File Format for 3D Printing - Explained in Simple erms"
T (https://all3dp.com/what-is-stl-file-format-extension-3d-
printing/). All3DP. 17 November 2016. Retrieved 5 May 2017.
9. "STL 2.0 May Replace Old, Limited File Format"(http://www.rapidtoday.com/stl-file-format.html). RapidToday.
Retrieved 5 May 2017.
10. Hiller, Jonathan D.; Lipson, Hod (2009)."STL 2.0: A Proposal for a Universal Multi-Material Additive Manufacturing
File Format" (https://sffsymposium.engr.utexas.edu/Manuscripts/2009/2009-23-Hiller .pdf) (PDF). Cornell University.
Retrieved 5 May 2017.
11. "Export to STL file format - Solid Utopia"(http://solidutopia.com/export-to-stl-format). solidutopia.com. 11 March
2015.
External links
The StL Format: Standard Data Format for Fabbers
File Extension STL: List of software to work with STL file