git ssb

0+

Dominic / cad2



Tree: 485abbed38bbfd00fab0954f74231a8d4085db0d

Files: 485abbed38bbfd00fab0954f74231a8d4085db0d / 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