From c7f4553b4e9698be94e8ed5199132596a05a2355 Mon Sep 17 00:00:00 2001 From: Peter Uithoven Date: Mon, 3 Jul 2017 14:44:40 +0200 Subject: [PATCH 1/4] Added name to package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9a267e0..3cfec23 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "name": "Doodle3D-Slicer" "jspm": { "name": "slicer", "main": "index.js", From d8fdfd3e11f35e26a15a191909ceec1ac17742cb Mon Sep 17 00:00:00 2001 From: Peter Uithoven Date: Mon, 3 Jul 2017 14:45:11 +0200 Subject: [PATCH 2/4] Fixed package.json syntax error --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3cfec23..675f540 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Doodle3D-Slicer" + "name": "Doodle3D-Slicer", "jspm": { "name": "slicer", "main": "index.js", From b517ad222bbeafe51955200fe574c9343f3fc695 Mon Sep 17 00:00:00 2001 From: Peter Uithoven Date: Mon, 3 Jul 2017 14:47:34 +0200 Subject: [PATCH 3/4] Added version to package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 675f540..86130ee 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "Doodle3D-Slicer", + "version": "0.0.1", "jspm": { "name": "slicer", "main": "index.js", From 94c21360b2c3fc9b45f54994a7c80fa67b0249cb Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 7 Jul 2017 18:10:29 +0200 Subject: [PATCH 4/4] Added simple example --- jspm.config.js | 5 +++-- package.json | 2 +- simpleExample/index.html | 15 +++++++++++++++ simpleExample/index.js | 16 ++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 simpleExample/index.html create mode 100644 simpleExample/index.js 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