diff --git a/jspm.config.js b/jspm.config.js index 504d761..251fc81 100644 --- a/jspm.config.js +++ b/jspm.config.js @@ -174,7 +174,7 @@ SystemJS.config({ "module": "npm:jspm-nodelibs-module@0.2.0", "os": "npm:jspm-nodelibs-os@0.2.0", "path": "npm:jspm-nodelibs-path@0.2.0", - "process": "npm:jspm-nodelibs-process@0.2.0", + "process": "github:jspm/nodelibs-process@0.2.0-alpha", "stream": "npm:jspm-nodelibs-stream@0.2.0", "string_decoder": "npm:jspm-nodelibs-string_decoder@0.2.0", "tty": "npm:jspm-nodelibs-tty@0.2.0", @@ -419,7 +419,8 @@ SystemJS.config({ }, "github:Doodle3D/clipper-js@1.0.2": { "map": { - "Breush/clipper-lib": "github:Breush/clipper-lib@patch-1" + "Breush/clipper-lib": "github:Breush/clipper-lib@patch-1", + "clipper-lib": "npm:clipper-lib@6.2.1" } } } diff --git a/package.json b/package.json index 86130ee..ed213cc 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "module": "npm:jspm-nodelibs-module@^0.2.0", "os": "npm:jspm-nodelibs-os@^0.2.0", "path": "npm:jspm-nodelibs-path@^0.2.0", - "process": "npm:jspm-nodelibs-process@^0.2.0", + "process": "github:jspm/nodelibs-process@^0.2.0-alpha", "stream": "npm:jspm-nodelibs-stream@^0.2.0", "string_decoder": "npm:jspm-nodelibs-string_decoder@^0.2.0", "tty": "npm:jspm-nodelibs-tty@^0.2.0", diff --git a/simpleExample/index.html b/simpleExample/index.html new file mode 100644 index 0000000..73457e1 --- /dev/null +++ b/simpleExample/index.html @@ -0,0 +1,15 @@ + + + + Doodle3D Slicer - Simple example + + + + + + +
+ + diff --git a/simpleExample/index.js b/simpleExample/index.js new file mode 100644 index 0000000..3db1410 --- /dev/null +++ b/simpleExample/index.js @@ -0,0 +1,16 @@ +import 'three.js'; +import * as SLICER from 'src/index.js'; + +const settings = new SLICER.Settings({ + ...SLICER.printerSettings['ultimaker2go'], + ...SLICER.userSettings.low +}); + +const geometry = new THREE.TorusGeometry(20, 10, 30, 30).clone(); + +const slicer = new SLICER.Slicer(); + +slicer.setGeometry(geometry); +slicer.slice(settings, false).then(gcode => { + document.getElementById('gcode').innerHTML = gcode.replace(/(?:\r\n|\r|\n)/g, '
'); +}); \ No newline at end of file