ThreeJS-export-STL
STL exporter for three.js
Can create both binary
and ascii
STL's.
Example
;;; const geometry = 1 1 1;const material = color: 0x00ff00 wireframe: true ;const mesh = geometry material; meshpositiony = 05; const buffer = exportSTL;const blob = buffer type: exportSTLmimeType ; ;
Installation
Using JSPM (ECMAScript / ES6 Module)
Install the library.
jspm install github:Doodle3D/ThreeJS-export-STL
Include the library.
;
Using NPM (CommonJS module)
Install the library.
npm install threejs-export-stl --save
Include the library.
const exportSTL = ;
API
exportSTL.fromMesh
data: String || Buffer = exportSTL
Creates a .STL from THREE.Mesh
. When binary is set to true
result will be a Buffer
Object, when set to false result will be an ASCII string. The transformation on the THREE.Mesh
will be applied to the STL geometry.
exportSTL.fromGeometry
data: String || Buffer = exportSTL
Creates a .STL from THREE.Geometry
. When binary is set to true
result will be a Buffer
Object, when set to false result will be an ASCII string. The transformation from the optional matrix
argument will be applied to the STL geometry.
exportSTL.mimeType
mimeType: String = exportSTLmimeType
A constant with the mime type of STL (application/vnd.ms-pki.stl
).