parse-stl

1.0.2 • Public • Published

parse-stl

STL (ASCII and binary) file parser

Parses an STL (STereoLithography) ASCII or binary buffer to a mesh compatible with simplicial-complex*. If you're looking for a streaming parser check this.

This module works well with merge-vertices to deduplicate identical vertices from different faces.

* ASCII files having faces with more than 3 vertices will have to be triangulated for use with simplicial-complex. One option is using earcut.

Install

$ npm install parse-stl

Usage

var parseSTL = require('parse-stl');
var fs = require('fs');
 
var buf = fs.readFileSync('mesh.stl');
var mesh = parseSTL(buf);
 
console.log(mesh);
/*
{
  positions: [...],
  cells: [...],
  faceNormals: [...]
}
*/

Readme

Keywords

Package Sidebar

Install

npm i parse-stl

Weekly Downloads

68

Version

1.0.2

License

MIT

Last publish

Collaborators

  • thibauts