An exporter for the STL file format.
STL files describe only the surface geometry of a three-dimensional object without any representation of color, texture or other common model attributes. The STL format specifies both ASCII and binary representations, with binary being more compact. STL files contain no scale information or indexes, and the units are arbitrary.
Import
STLExporter is an add-on, and must be imported explicitly. See Installation / Addons.
import { STLExporter } from 'three/addons/exporters/STLExporter.js';
Code Example
// Instantiate an exporter
const exporter = new STLExporter();
// Configure export options
const options = { binary: true }
// Parse the input and generate the STL encoded output
const result = exporter.parse( mesh, options );
Examples
Constructor
STLExporter()
Creates a new STLExporter.
Methods
.parse ( scene : Object3D, options : Object ) : Object
scene — Scene, Mesh, or other Object3D based class containing Meshes to encode.
options — Optional export options
- binary – bool. Return an ASCII encoded string or binary data buffer. Default is
false.