serialize-stl-binary
v1.0.0
Published
STL binary serialization
Downloads
15
Readme
serialize-stl-binary
STL binary serialization
Produces a STL (STereoLithography) binary buffer from a mesh. Face normals are computed internally if not provided.
Install
$ npm install serialize-stl-binary
Usage
var serializeSTL = require('serialize-stl-binary');
var fs = require('fs');
var mesh = {
positions: [
[-1.0, 0.0, 0.0],
[ 0.0, 1.0, 0.0],
[ 1.0, 0.0, 0.0]
],
cells: [
[0, 1, 2]
]
};
var buf = serializeSTL(mesh.cells, mesh.positions/*, faceNormals*/);
fs.writeFileSync('mesh.stl', buf);