serialize-stl-binary

1.0.0 • Public • Published

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);

Package Sidebar

Install

npm i serialize-stl-binary

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • thibauts