
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
@doodle3d/threejs-export-stl
Advanced tools
STL exporter for three.js
Can create both binary and ascii STL's.
import * as THREE from 'three';
import { saveAs } from 'file-saver';
import * as exportSTL from 'Doodle3D/ThreeJS-export-STL';
const geometry = new THREE.BoxGeometry(1, 1, 1).clone();
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true });
const mesh = new THREE.Mesh(geometry, material);
mesh.position.y = 0.5;
const buffer = exportSTL.fromMesh(mesh);
const blob = new Blob([buffer], { type: exportSTL.mimeType });
saveAs(blob, 'cube.stl');
Install the library.
jspm install github:Doodle3D/ThreeJS-export-STL
Include the library.
import * as exportSTL from 'Doodle3D/ThreeJS-export-STL';
Install the library.
npm install threejs-export-stl --save
Include the library.
const exportSTL = require('threejs-export-stl');
exportSTL.fromMesh
data: String || Buffer = exportSTL.fromMesh( mesh: THREE.Mesh, [ binary: Boolean = true ] )
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.fromGeometry( geometry: THREE.Geometry || THREE.BufferGeometry, [ matrix: THREE.Matrix4, binary: Boolean = true ] )
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 = exportSTL.mimeType
A constant with the mime type of STL (application/vnd.ms-pki.stl).
FAQs
ThreeJS STL Exporter
We found that @doodle3d/threejs-export-stl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.