Closed jasonwebb closed 5 years ago
@jasonwebb Thanks for the interest.
Please see the CLI (command line application) package as part of OpenJSCAD.org repository. I believe the README file is up to date. (packages/cli)
Thanks! I looked at that earlier and didn't know if I could make it work for my application, but now I'm thinking I can use Node's child_process.exec()
method to run the commands needed. I'm wanting to iterate over a set of SVG files spread across multiple directories, spitting out STLs files for each one by extruding their paths. Seems like I should be able to create a Node script that does the traversing and SVG parsing, then child_prrocess.exec()
to do the STL creation 🤔 Thanks!
@jasonwebb It's unlikely you still need this but I though I would comment just in case.
The easiest way to write buffers in node is to use a stream.
const file = fs.createWriteStream('test.stl')
rawData.forEach(buf => file.write(Buffer.from(buf)))
I'm looking into whether or not its possible to create and write STL files to the filesystem using Node only, without a browser. When looking at the usage example provided for in the
@jscad/stl-seializer
package, I see it uses Blob, which is not available in Node.Can anyone provide some tips on how I can take my geometry data and turn it into an STL file on my filesystem?
I've tried using blob, node-blob (as in my example below), file-saver, and saveAs, but haven't gotten any of them to work. I have a feeling I may be approaching this wrong, so I'm partly asking here as a sanity check :) Any ideas?