diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a17e2b0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+
+.DS_Store
+
+.DS_Store
+
+src/.DS_Store
+
+src/.DS_Store
+
+src/library/.DS_Store
+
+.DS_Store
+
+src/script/.DS_Store
+
+src/.DS_Store
diff --git a/src/doodle.html b/doodle.html
similarity index 95%
rename from src/doodle.html
rename to doodle.html
index 65cc65c..57eeac0 100644
--- a/src/doodle.html
+++ b/doodle.html
@@ -7,10 +7,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/favicon.ico b/favicon.ico
similarity index 100%
rename from src/favicon.ico
rename to favicon.ico
diff --git a/src/favicon.png b/favicon.png
similarity index 100%
rename from src/favicon.png
rename to favicon.png
diff --git a/src/favicon_alt.ico b/favicon_alt.ico
similarity index 100%
rename from src/favicon_alt.ico
rename to favicon_alt.ico
diff --git a/src/gcode/easterbunny.js b/gcode/easterbunny.js
similarity index 100%
rename from src/gcode/easterbunny.js
rename to gcode/easterbunny.js
diff --git a/src/gcode/testgcode.js b/gcode/testgcode.js
similarity index 100%
rename from src/gcode/testgcode.js
rename to gcode/testgcode.js
diff --git a/src/index.html b/index.html
similarity index 91%
rename from src/index.html
rename to index.html
index edf8802..c669503 100644
--- a/src/index.html
+++ b/index.html
@@ -3,9 +3,9 @@
Doedel Drie Dee
-
-
-
+
+
+
diff --git a/src/library/cal.js b/library/cal.js
similarity index 100%
rename from src/library/cal.js
rename to library/cal.js
diff --git a/src/library/csg.js b/library/csg.js
similarity index 100%
rename from src/library/csg.js
rename to library/csg.js
diff --git a/src/library/jquery.js b/library/jquery.js
similarity index 100%
rename from src/library/jquery.js
rename to library/jquery.js
diff --git a/src/library/three.js b/library/three.js
similarity index 100%
rename from src/library/three.js
rename to library/three.js
diff --git a/src/slice_test.html b/slice_test.html
similarity index 88%
rename from src/slice_test.html
rename to slice_test.html
index 5409c2c..61a7f9f 100644
--- a/src/slice_test.html
+++ b/slice_test.html
@@ -6,10 +6,10 @@
-
-
-
-
+
+
+
+
@@ -55,9 +55,10 @@ scene.add(mesh);
var slicer = new D3D.Slicer(geometry);
-/*var slices = slicer.slice(20, 0.2);
+var slices = slicer.slice(200, 0.2);
+//document.write(JSON.stringify(slices));
-var canvas = document.getElementById("canvas");
+/*var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
for (var layer = 0; layer < slices.length; layer ++) {
diff --git a/src/.DS_Store b/src/.DS_Store
deleted file mode 100644
index 946a3d3..0000000
Binary files a/src/.DS_Store and /dev/null differ
diff --git a/src/script/box.js b/src/box.js
similarity index 100%
rename from src/script/box.js
rename to src/box.js
diff --git a/src/library/.DS_Store b/src/library/.DS_Store
deleted file mode 100644
index c7a6b55..0000000
Binary files a/src/library/.DS_Store and /dev/null differ
diff --git a/src/script/printer.js b/src/printer.js
similarity index 96%
rename from src/script/printer.js
rename to src/printer.js
index 9130692..22ba9ff 100644
--- a/src/script/printer.js
+++ b/src/printer.js
@@ -9,7 +9,9 @@ D3D.Printer = function (config) {
"use strict";
for (var i in config) {
- this[i] = config[i];
+ if (i.indexOf("printer") === 0) {
+ this[i] = config[i];
+ }
}
};
D3D.Printer.prototype.getStartCode = function () {
diff --git a/src/script/.DS_Store b/src/script/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/src/script/.DS_Store and /dev/null differ
diff --git a/src/script/slicer.js b/src/slicer.js
similarity index 89%
rename from src/script/slicer.js
rename to src/slicer.js
index 90a77fc..d03a7cf 100644
--- a/src/script/slicer.js
+++ b/src/slicer.js
@@ -142,23 +142,22 @@ D3D.Slicer.prototype.getGcode = function (printer) {
var travelSpeed = doodleBox.printer["printer.travelSpeed"];
var filamentThickness = doodleBox.printer["printer.filamentThickness"];
var wallThickness = doodleBox.printer["printer.wallThickness"];
- var screenToMillimeterScale = doodleBox.printer["printer.screenToMillimeterScale"];
var layerHeight = doodleBox.printer["printer.layerHeight"];
- var useSubLayers = doodleBox.printer["printer.useSubLayers"];
var enableTraveling = doodleBox.printer["printer.enableTraveling"];
var retractionEnabled = doodleBox.printer["printer.retraction.enabled"];
- var retractionspeed = doodleBox.printer["printer.retraction.speed"];
+ var retractionSpeed = doodleBox.printer["printer.retraction.speed"];
var retractionminDistance = doodleBox.printer["printer.retraction.minDistance"];
- var retractionamount = doodleBox.printer["printer.retraction.amount"];
+ var retractionAmount = doodleBox.printer["printer.retraction.amount"];
+ var dimensionsZ = doodleBox.printer["printer.dimensions.z"];
var gcode = doodleBox.printer.getStartCode();
var extruder = 0.0;
- var speed = (bottomSpeed*60).toFixed(3);
+ var speed = firstLayerSlow ? (bottomSpeed*60).toFixed(3) : (normalSpeed*60).toFixed(3);
var flowRate = bottomFlowRate;
var filamentSurfaceArea = Math.pow((filamentThickness/2), 2) * Math.PI;
- var slices = this.slice(200, layerHeight);
+ var slices = this.slice(dimensionsZ, layerHeight);
for (var layer = 0; layer < slices.length; layer ++) {
var slice = slices[layer];
@@ -184,11 +183,11 @@ D3D.Slicer.prototype.getGcode = function (printer) {
if (j === 0) {
//TODO
//add retraction
- if (extruder > retractionamount && retractionEnabled) {
+ if (extruder > retractionAmount && retractionEnabled) {
gcode.push([
"G0",
- "E" + (extruder - retractionamount).toFixed(3),
- "F" + (retractionspeed * 60).toFixed(3)
+ "E" + (extruder - retractionAmount).toFixed(3),
+ "F" + (retractionSpeed * 60).toFixed(3)
].join(" "));
}
@@ -198,11 +197,11 @@ D3D.Slicer.prototype.getGcode = function (printer) {
"F" + (travelSpeed*60)
].join(" "));
- if (extruder > retractionamount && retractionEnabled) {
+ if (extruder > retractionAmount && retractionEnabled) {
gcode.push([
"G0",
"E" + extruder.toFixed(3),
- "F" + (retractionspeed * 60).toFixed(3)
+ "F" + (retractionSpeed * 60).toFixed(3)
].join(" "));
}
}
diff --git a/src/script/utils.js b/src/utils.js
similarity index 100%
rename from src/script/utils.js
rename to src/utils.js