Commit 485abbed38bbfd00fab0954f74231a8d4085db0d
accept options
Dominic Tarr committed on 12/30/2017, 8:03:14 AMParent: 40df1e4adf03ffd3ca6ae2f657731534e10fa676
Files changed
index.js | changed |
package.json | changed |
index.js | ||
---|---|---|
@@ -14,12 +14,15 @@ | ||
14 | 14 … | resize() |
15 | 15 … | |
16 | 16 … | document.body.appendChild(container) |
17 | 17 … | |
18 | -var v = require('jscad-viewer')(container, {}) | |
18 … | +var opts = require('minimist')(process.argv.slice(2)) | |
19 | 19 … | |
20 … | +var v = new (require('jscad-viewer'))(container, opts) | |
21 … | + | |
20 | 22 … | var model = require(path.resolve(process.cwd(), process.argv[2]))(csg) |
23 … | +V = v | |
21 | 24 … | v.setCsg(model) |
22 | 25 … | |
26 … | +//var base64 = v.canvas.toDataURL('image/png') | |
27 … | +//require('fs').writeFileSync('output.png', new Buffer(base64.substring(base64.indexOf(',')+1), 'base64')) | |
23 | 28 … | |
24 | - | |
25 | - |
package.json | ||
---|---|---|
@@ -8,9 +8,10 @@ | ||
8 | 8 … | "url": "git://github.com/dominictarr/cad2.git" |
9 | 9 … | }, |
10 | 10 … | "dependencies": { |
11 | 11 … | "cardinal-spline-js": "^2.3.6", |
12 | - "jscad-viewer": "^1.0.0" | |
12 … | + "jscad-viewer": "^1.0.0", | |
13 … | + "minimist": "^1.2.0" | |
13 | 14 … | }, |
14 | 15 … | "devDependencies": {}, |
15 | 16 … | "scripts": { |
16 | 17 … | "test": "set -e; for t in test/*.js; do node $t; done" |
Built with git-ssb-web