STL (.stl)

BackgroundBackground

    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.
    Stores a 3D object, including solid, as a surface formed by a collection of adjacent triangles.

Import and ExportImport and Export

  • Import["file.stl"] imports an STL file as a MeshRegion object representing the surface.
  • Import["file.stl",elem] imports the specified element from an STL file.
  • The import format can be specified with Import["file","STL"] or Import["file",{"STL",elem,}].
  • Export["file.stl",expr] exports a 3D mesh-based geometric region to a binary STL file. The expr can be any region that is ConstantRegionQ or a Graphics or Graphics3D object.
  • Export["file.stl",expr,{opt1->val1,}] exports expr with the specified options for the file format.
  • The export format can be specified with Export["file",expr,"STL"] or Export["file",expr,{"STL",opt1->val1,}].
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the STL format.

ElementsElements

  • General Import elements:
  • "Elements"list of elements available in this file
    "Rules"list of rules for each element
    "Options"list of options and settings
    "Summary"summary of properties
    "CoordinateTransform"transformation function from STL format
  • Data format representation elements:
  • "BinaryFormat"whether the file is a binary or ASCII STL
    "Comments"comments
    "VertexData"list of vertex coordinates
    "PolygonData"list of polygon elements in indexed form
    "PolygonCount"number of polygons
  • Geometry representation elements:
  • boundary mesh representation of a solid
    mesh representation of a surface
  • Graphics representation elements:
  • "Graphics3D"STL file represented as a Graphics3D object
    "GraphicsComplex"STL file as a GraphicsComplex object
    "PolygonObjects"list of polygon primitives in absolute coordinates
  • Import and Export use the element by default for STL files.

OptionsOptions

  • Export options:
  • "BinaryFormat"Truewhether to write a binary or ASCII file

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Import a 3D model from STL as a MeshRegion object:

In[1]:=
Click for copyable input
Out[1]=

Summary properties of the solid model:

In[2]:=
Click for copyable input
Out[2]=

Export a 3D model to an ASCII STL file:

In[1]:=
Click for copyable input
Out[1]=

Print the raw textual contents of the file:

Introduced in 2000
(4.1)
| Updated in 2015
(10.2)
Translate this page: