git ssb

0+

Dominic / cad2



Commit 485abbed38bbfd00fab0954f74231a8d4085db0d

accept options

Dominic Tarr committed on 12/30/2017, 8:03:14 AM
Parent: 40df1e4adf03ffd3ca6ae2f657731534e10fa676

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -14,12 +14,15 @@
1414 resize()
1515
1616 document.body.appendChild(container)
1717
18-var v = require('jscad-viewer')(container, {})
18 +var opts = require('minimist')(process.argv.slice(2))
1919
20 +var v = new (require('jscad-viewer'))(container, opts)
21 +
2022 var model = require(path.resolve(process.cwd(), process.argv[2]))(csg)
23 +V = v
2124 v.setCsg(model)
2225
26 +//var base64 = v.canvas.toDataURL('image/png')
27 +//require('fs').writeFileSync('output.png', new Buffer(base64.substring(base64.indexOf(',')+1), 'base64'))
2328
24-
25-
package.jsonView
@@ -8,9 +8,10 @@
88 "url": "git://github.com/dominictarr/cad2.git"
99 },
1010 "dependencies": {
1111 "cardinal-spline-js": "^2.3.6",
12- "jscad-viewer": "^1.0.0"
12 + "jscad-viewer": "^1.0.0",
13 + "minimist": "^1.2.0"
1314 },
1415 "devDependencies": {},
1516 "scripts": {
1617 "test": "set -e; for t in test/*.js; do node $t; done"

Built with git-ssb-web