git ssb

0+

Dominic / cad2



Tree: 4811bd9f673ac20d7ecf3d72f06c219cef743535

Files: 4811bd9f673ac20d7ecf3d72f06c219cef743535 / index.js

738 bytesRaw
1var csg = require('@jscad/csg')
2var path = require('path')
3var container = document.createElement('div')
4function resize () {
5 container.style.height = (window.innerHeight - 4)+'px'
6 container.style.width = (window.innerWidth - 4)+'px'
7}
8document.body.style.margin = '0px'
9
10CSG = csg.CSG
11CAG = csg.CAG
12
13window.onresize = resize
14resize()
15
16document.body.appendChild(container)
17
18var opts = require('minimist')(process.argv.slice(2))
19
20var v = new (require('jscad-viewer'))(container, opts)
21
22var model = require(path.resolve(process.cwd(), process.argv[2]))(csg)
23V = v
24v.setCsg(model)
25
26//var base64 = v.canvas.toDataURL('image/png')
27//require('fs').writeFileSync('output.png', new Buffer(base64.substring(base64.indexOf(',')+1), 'base64'))
28
29

Built with git-ssb-web