HOME

TheInfoList



OR:

STL is a
file format A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free. Some file format ...
native to the stereolithography
CAD Computer-aided design (CAD) is the use of computers (or ) to aid in the creation, modification, analysis, or optimization of a design. This software is used to increase the productivity of the designer, improve the quality of design, improve c ...
software created by 3D Systems. STL has several
backronym A backronym is an acronym formed from an already existing word by expanding its letters into the words of a phrase. Backronyms may be invented with either serious or humorous intent, or they may be a type of false etymology or folk etymology. The ...
s such as "Standard Triangle Language" and "Standard Tessellation Language". This file format is supported by many other software packages; it is widely used for
rapid prototyping Rapid prototyping is a group of techniques used to quickly fabricate a scale model of a physical part or assembly using three-dimensional computer aided design (CAD) data. Construction of the part or assembly is usually done using 3D printing ...
,
3D printing 3D printing or additive manufacturing is the construction of a three-dimensional object from a CAD model or a digital 3D model. It can be done in a variety of processes in which material is deposited, joined or solidified under computer co ...
and
computer-aided manufacturing Computer-aided manufacturing (CAM) also known as computer-aided modeling or computer-aided machining is the use of software to control machine tools in the manufacturing of work pieces. This is not the only definition for CAM, but it is the most ...
. STL files describe only the surface geometry of a three-dimensional object without any representation of color, texture or other common CAD model attributes. The STL format specifies both
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
and binary representations. Binary files are more common, since they are more compact. An STL file describes a raw, unstructured triangulated surface by the
unit Unit may refer to: Arts and entertainment * UNIT, a fictional military organization in the science fiction television series ''Doctor Who'' * Unit of action, a discrete piece of action (or beat) in a theatrical presentation Music * ''Unit'' (a ...
normal and vertices (ordered by the
right-hand rule In mathematics and physics, the right-hand rule is a common mnemonic for understanding orientation of axes in three-dimensional space. It is also a convenient method for quickly finding the direction of a cross-product of 2 vectors. Most of ...
) of the triangles using a three-dimensional
Cartesian coordinate system A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...
. In the original specification, all STL coordinates were required to be positive numbers, but this restriction is no longer enforced and negative coordinates are commonly encountered in STL files today. STL files contain no scale information, and the units are arbitrary. Reprinted from '' Automated Fabrication''.


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 remainder of the line is ignored and is sometimes used to store metadata (e.g., filename, author, modification date, etc). The file continues with any number of triangles, each represented as follows: facet normal ni nj 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 Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to r ...
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, all facets are simple triangles. Whitespace (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.


Binary STL

Because ASCII STL files can be very large, a binary version of STL exists. A binary STL file has an 80-character header (which is generally ignored, but should never begin with solid because that may lead some software to assume that this is an ASCII STL file). Following the header is a 4-byte little-endian unsigned integer indicating the number of triangular facets in the file. Following that is data describing each triangle in turn. The file simply ends after the last triangle. 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 count" – in the standard format, this should be zero because most software does not understand anything else. Floating-point numbers are represented as IEEE floating-point numbers and are assumed to be little-endian, although this is not stated in documentation. UINT8 0 – Header - 80 bytes UINT32 – Number of triangles - 4 bytes foreach triangle - 50 bytes: REAL32 – Normal vector - 12 bytes REAL32 – Vertex 1 - 12 bytes REAL32 – Vertex 2 - 12 bytes REAL32 – Vertex 3 - 12 bytes UINT16 – Attribute byte count - 2 bytes end


Color in binary STL

There are at least two non-standard variations on the binary STL format for adding color information: * 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: ** bits 0–4 are the intensity level for blue (0–31), ** bits 5–9 are the intensity level for green (0–31), ** bits 10–14 are the intensity level for red (0–31), ** bit 15 is 1 if the color is valid, or 0 if the color is not valid (as with normal STL files). * The Materialise Magics software uses the 80-byte header at the top of the file to represent the overall color of the entire part. If color is used, then somewhere in the header should be the
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
string COLOR= followed by four bytes representing red, green, blue and alpha channel (transparency) in the range 0–255. This is the color of the entire object, unless overridden at each facet. Magics also recognizes a material description; a more detailed surface characteristic. Just after COLOR=RGBA specification should be another ASCII string ,MATERIAL= followed by three colors (3×4 bytes): first is a color of
diffuse reflection Diffuse reflection is the reflection of light or other waves or particles from a surface such that a ray incident on the surface is scattered at many angles rather than at just one angle as in the case of specular reflection. An ''ideal'' ...
, second is a color of
specular highlight A specular highlight is the bright spot of light that appears on shiny objects when illuminated (for example, see image on right). Specular highlights are important in 3D computer graphics, as they provide a strong visual cue for the shape of a ...
, and third is an ambient light. Material settings are preferred over color. The per-facet color is represented in the two "attribute byte count" bytes as follows: ** bits 0–4 are the intensity level for red (0–31), ** bits 5–9 are the intensity level for green (0–31), ** bits 10–14 are the intensity level for blue (0–31), ** bit 15 is 0 if this facet has its own unique color, or 1 if the per-object color is to be used. 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.


Units in binary STL

The coordinate units are not specified in the STL standard. One idea is to add an
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
string UNITS=xx somewhere in the header, where xx are two bytes representing the units used, when writing this file. Possible options are:


The facet normal

In both ASCII and binary versions of STL, the facet normal should be a
unit vector In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat"). The term ''direction v ...
pointing outwards from the solid object. In most software this may be set to (0,0,0), and the software will automatically calculate a normal based on the order of the triangle vertices using the "
right-hand rule In mathematics and physics, the right-hand rule is a common mnemonic for understanding orientation of axes in three-dimensional space. It is also a convenient method for quickly finding the direction of a cross-product of 2 vectors. Most of ...
", i.e. the vertices are listed in counter-clock-wise order from outside. Some STL loaders (e.g. the STL plugin for Art of Illusion) check that the normal in the file agrees with the normal they calculate using the right-hand rule and warn the user when it does not. Other software may ignore the facet normal entirely and use only the right-hand rule. Although it is rare to specify a normal that cannot be calculated using the right-hand rule, in order to be entirely portable, a file should both provide the facet normal and order the vertices appropriately. A notable exception is
SolidWorks SolidWorks is a solid modeling computer-aided design (CAD) and computer-aided engineering (CAE) application published by Dassault Systèmes. According to the publisher, over two million engineers and designers at more than 165,000 companies w ...
, which uses the normal for shading effects.


Use in 3D printing

3D printers build objects by solidifying ( SLA, SLS, SHS, DMLS, EBM, DLP) or printing (3DP, MJM, FDM, FFF, PJP, MJS) one layer at a time. This requires a series of closed 2D contours (horizontal layers) 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 (layers or slices) 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 In geometry, a polyhedron (plural polyhedra or polyhedrons; ) is a three-dimensional shape with flat polygonal faces, straight edges and sharp corners or vertices. A convex polyhedron is the convex hull of finitely many points, not all o ...
that can be sliced at the necessary horizontal levels. An incorrect facet normal can affect the way a file is sliced and filled. A slice at a different Z-value can be chosen to miss a bad facet or the file must be returned to CAD program to make corrections and then regenerate the STL file. 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 (no holes or reversed vector normal) 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 void does not matter. The missing surface 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, and may require repair using another program. Vector 3D printers require a clean STL file and printing a bad data file will either fail to fill or may stop printing.


Use in other fields

STL file format is simple and easy to output. Consequently, many
computer-aided design Computer-aided design (CAD) is the use of computers (or ) to aid in the creation, modification, analysis, or optimization of a design. This software is used to increase the productivity of the designer, improve the quality of design, improve co ...
systems can output the STL file format. Although the output is simple to produce, mesh connectivity information is discarded because the identity of shared vertices is lost. Many
computer-aided manufacturing Computer-aided manufacturing (CAM) also known as computer-aided modeling or computer-aided machining is the use of software to control machine tools in the manufacturing of work pieces. This is not the only definition for CAM, but it is the most ...
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. As STL files do not save the physical dimension of a unit, a CAM system will ask for it. Typical units are mm and inch. STL can also be used for interchanging data between CAD/CAM systems and computational environments such as
Mathematica Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimiza ...
.


Representation of curved surfaces

It is not possible to use triangles to perfectly represent curved surfaces. To compensate, users often save enormous STL files to reduce the inaccuracy. However, native formats associated with many 3D design applications use mathematical surfaces to preserve detail losslessly in small files. For example,
Rhino 3D Rhinoceros (typically abbreviated Rhino or Rhino3D) is a commercial 3D computer graphics and computer-aided design (CAD) application software that was developed by Robert McNeel & Associates, an American, privately held, and employee-owned com ...
and Blender implement NURBS to create true curved surfaces and store them in their respective native file formats, but must generate a triangle mesh when exporting a model to the STL format.


History

STL was invented by the Albert Consulting Group for 3D Systems in 1987. The format was developed for 3D Systems' first commercial 3D printers. Since its initial release, the format remained relatively unchanged for 22 years. In 2009, an update to the format, dubbed STL 2.0, was proposed. It evolved into the Additive manufacturing file format. The oldest existing STL file in WikiCommons as of 2022 is Goat5k.stl, 2018-01-10.From this query, largest whatevers on Commons.


See also

*
3D Manufacturing Format 3D Manufacturing Format or 3MF is an open source file format standard developed and published by the 3MF Consortium. 3MF is an XML-based data format designed specifically for additive manufacturing. It includes information about materials, colors, ...
(3MF), a standard for 3D file manufacturing * Additive Manufacturing File Format (AMF), a standard with support for color, multiple materials, and constellations * PLY (file format), an alternative file format * Voxel *
Wavefront .obj file OBJ (or .OBJ) is a geometry definition file format first developed by Wavefront Technologies for its Advanced Visualizer animation package. The file format is open and has been adopted by other 3D graphics application vendors. The OBJ file form ...
, a 3D geometry definition file format with ''.obj'' file extension * X3D, a royalty-free ISO standard for 3D computer graphics


References


External links


The STL Format
- Standard Data Format for Fabbers

- Contains various STL file samples {{CAD software 3D graphics file formats CAD file formats