This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Mathematica Import/Export Format

STL (.stl)

MIME type: application/sla
STL computer-aided design and manufacturing format.
3D geometry format.
Commonly used for representing solid models in rapid prototyping systems.
Native format of the 3D Systems stereolithography CAD software.
Developed in 1989 by 3D Systems, Inc.
STL is an acronym derived from stereolithography.
ASCII or binary format.
Binary STL files store data using little-endian byte ordering.
Stores a solid 3D object as a surface formed by a collection of adjacent triangles.
Does not store color information.
  • Export["file.stl", Graphics3D[...]] creates an STL file representing a solid physical model.
  • Import["file.stl", elem] imports the specified element from an STL file.
  • Import["file.stl", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.stl", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file","STL"] or Import["file", {"STL", elem, ...}].
  • Export["file.stl", expr, elem] creates a binary STL file by treating expr as specifying element elem.
  • Export["file.stl", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file.stl", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.stl", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Data representation elements:
"Graphics3D"STL file represented as a Graphics3D object
"GraphicsComplex"STL file as a GraphicsComplex object
"PolygonData"the polygon elements in indexed form
"PolygonObjects"list of Polygon primitives given in absolute coordinates
"VertexData"list of vertex coordinates
  • Import and Export use the "Graphics3D" element by default for STL files.
  • The "VertexData" element corresponds to the first argument of GraphicsComplex.
"BinaryFormat"whether the file is a binary or ASCII STL
ImageSizeAutomaticspecifies the overall size of the graphics to display
BackgroundAutomaticspecifies what background color to use
"BinaryFormat"Truewhether to write a binary or ASCII file
"SurfaceOrientation"Automaticspecifies how triangles should be oriented
  • Possible settings for "SurfaceOrientation" are:
Automaticspecifies no orientation
{x,y,z}triangle faces are oriented toward the given point
Infinitytriangles face away from the origin of the coordinate system