STL Parser
STL-parser is a transform stream which convert STL-files to newline separated JSON events for each face. Check out jsonlines.org for a detailed specification of the jsonl format.
Installation
As a module for your project:
npm install stl-parser
As a command line program:
npm install -g stl-parser
Usage
Command Line Interface
cat test.stl | stl-parser
This emits a jsonl file-stream with header and facet events.
The cli flags --ascii
and --binary
can be used to enforce
parsing with the specified file-encoding.
Javascript API
var stlParser = stlStream = fs outputFile = fs stlStream
There is also the possibility to use it buffered and get one javascript object for the whole STL. This should, however, only be used for small files.
var stlParser = stl = fs