[name]

An exporter for the STL file format.

[link:https://en.wikipedia.org/wiki/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

[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation 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

[example:misc_exporter_stl]

Constructor

[name]()

Creates a new [name].

Methods

[method:Object parse]( [param:Object3D scene], [param:Object options] )

[page:Object3D scene] — Scene, Mesh, or other Object3D based class containing Meshes to encode.
[page:Options options] — Optional export options

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/STLExporter.js examples/jsm/exporters/STLExporter.js]