mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-26 07:24:57 +01:00
Added simple example
This commit is contained in:
parent
b517ad222b
commit
94c21360b2
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
15
simpleExample/index.html
Normal file
15
simpleExample/index.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE>
|
||||
<html>
|
||||
<head>
|
||||
<title>Doodle3D Slicer - Simple example</title>
|
||||
<script type="text/javascript" src="../jspm_packages/system.js"></script>
|
||||
<script type="text/javascript" src="../jspm.config.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
System.import('simpleExample/index.js');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="gcode"></div>
|
||||
</body>
|
||||
</html>
|
16
simpleExample/index.js
Normal file
16
simpleExample/index.js
Normal file
@ -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, '<br />');
|
||||
});
|
Loading…
Reference in New Issue
Block a user