tmpvar / stl

parse/serialize stl files
29 stars 7 forks source link

add streaming interface #1

Open tmpvar opened 11 years ago

stanbellcom commented 10 years ago

subscribe. with RAM 1gb it gives FATAL ERROR: JS Allocation failed - process out of memory on files of about 100 mb

tmpvar commented 10 years ago

@stanbellcom are you using stl.createParseStream?

stanbellcom commented 10 years ago

@tmpvar i was trying to, but could not find a proper example of how to use that.

could you provide one similar to this one:

var stl = require('stl')
var fs = require('fs');

var facets = stl.toObject(fs.readFileSync('/path/to/ascii.stl').toString());
fs.writeFileSync('/path/to/binary.stl', stl.fromObject(facets, true));

thanks in advance

tmpvar commented 10 years ago

ah, yeah the problem here is that the ascii stl files do not include the facet count which is needed to output binary. Let me give this some thought..

EDIT:

by output binary, I mean stream binary