stl2image
v0.0.1
Published
Node.js module for generate image files from STL files
Downloads
3
Maintainers
Readme
stl2image
This library is a fork of https://github.com/cubehero/stljs.
The main objective is to allow you to export stl (stereolitography) to images using pov-ray
Note: Currently, the readFile works for both binary and ascii files, but writing STL files is only in ASCII
This currently only works on node.js, but will expand to browser stl parsing soon
How to install
npm install stl2image
You need to have installed on your system Pov-ray (tested for >=3.6)
If you're on a mac, you can install it using homebrew.
brew install povray
If you're using ubuntu, you can install it using aptitude
aptitude install povray
In Windows, you can download and binary installable from Pov-Ray website.
Converting STL to PNG
Sometimes, you want to convert an STL file into a PNG file. To do that, we can
stl2image = require('stljs')
stl2image.imageify('teapot.stl', { width: 200, height: 100, dst: 'teapot.png' }
, (err, povOutput, name) ->
# done with converting the image
, (err, povPolygon, name) ->
# called on each polygon is processed
)
NOTE: In order to use this feature, you need to have pov-ray installed on your system already. This can be installed separately through 'aptitude' on linux and 'brew' on macs
License
MIT license