STL (Stereolithography Tesselation Language) format is widely used in rapid prototyping, and allows easy definition of very general shapes. It is based on a tri-mesh representation of the object, in which the surface shape of the object is approximated by a set of triangular facets.

Reference 1 gives a useful overview of the STL format. Each facet in an STL file is defined by the {x,y,z} coordinates of the three corners, and the surface normal vector. Here, for example, is the first few lines of a sample .stl file produced by AutoCAD:

 solid AutoCAD
   facet normal 0.0000000e+000 0.0000000e+000 1.0000000e+000
      outer loop
         vertex 6.0000000e+000 4.0000000e+000 6.0000000e+000
         vertex 6.0000000e+000 6.0000000e+000 6.0000000e+000
         vertex 4.0000000e+000 6.0000000e+000 6.0000000e+000
      endloop
   endfacet
   facet normal 0.0000000e+000 0.0000000e+000 1.0000000e+000
      outer loop
         vertex 6.0000000e+000 4.0000000e+000 6.0000000e+000
         vertex 4.0000000e+000 6.0000000e+000 6.0000000e+000
         vertex 4.0000000e+000 4.0000000e+000 6.0000000e+000
      endloop
   endfacet

(Note that ZEMAX imports both ASCII and binary versions of the STL format). The faceted nature of STL makes it ideal for modelling objects like faceted reflectors and prisms. However, it is less good at modelling smoothly curved objects, where the facetization errors are likely to affect ray-tracing accuracy.

STL objects are imported using the STL object type. The .stl file must be placed in the {zemaxroot}/objects folder.



Once imported it is positioned like any other object.

In this example, the prism is exactly modelled by flat facets, but the sphere is only approximated:

The prism is exact, but the sphere is approximate

The sphere is formed by a tri-mesh approximation:

A close-up of the sphere shows the approximation

In this case, the facets drawn on screen are exactly those generated in the STL file, and rays interact with a series of flat facets.