mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 04:27:55 +01:00
cleaner structure
This commit is contained in:
parent
921708331d
commit
ab9167e446
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
@ -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
|
@ -7,10 +7,10 @@
|
||||
<script src="library/cal.js"></script>
|
||||
<script src="library/three.js"></script>
|
||||
|
||||
<script src="script/utils.js"></script>
|
||||
<script src="script/box.js"></script>
|
||||
<script src="script/printer.js"></script>
|
||||
<script src="script/slicer.js"></script>
|
||||
<script src="src/utils.js"></script>
|
||||
<script src="src/box.js"></script>
|
||||
<script src="src/printer.js"></script>
|
||||
<script src="src/slicer.js"></script>
|
||||
|
||||
<script src="gcode/testgcode.js"></script>
|
||||
<script src="gcode/easterbunny.js"></script>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 814 B |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
@ -3,9 +3,9 @@
|
||||
<head>
|
||||
<title>Doedel Drie Dee</title>
|
||||
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||
<script src="script/utils.js"></script>
|
||||
<script src="script/box.js"></script>
|
||||
<script src="script/printer.js"></script>
|
||||
<script src="src/utils.js"></script>
|
||||
<script src="src/box.js"></script>
|
||||
<script src="src/printer.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
@ -6,10 +6,10 @@
|
||||
<script src="library/jquery.js"></script>
|
||||
<script src="library/three.js"></script>
|
||||
|
||||
<script src="script/utils.js"></script>
|
||||
<script src="script/box.js"></script>
|
||||
<script src="script/printer.js"></script>
|
||||
<script src="script/slicer.js"></script>
|
||||
<script src="src/utils.js"></script>
|
||||
<script src="src/box.js"></script>
|
||||
<script src="src/printer.js"></script>
|
||||
<script src="src/slicer.js"></script>
|
||||
|
||||
<script src="gcode/testgcode.js"></script>
|
||||
<script src="gcode/easterbunny.js"></script>
|
||||
@ -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 ++) {
|
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
BIN
src/library/.DS_Store
vendored
BIN
src/library/.DS_Store
vendored
Binary file not shown.
@ -9,8 +9,10 @@ D3D.Printer = function (config) {
|
||||
"use strict";
|
||||
|
||||
for (var i in config) {
|
||||
if (i.indexOf("printer") === 0) {
|
||||
this[i] = config[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
D3D.Printer.prototype.getStartCode = function () {
|
||||
"use strict";
|
BIN
src/script/.DS_Store
vendored
BIN
src/script/.DS_Store
vendored
Binary file not shown.
@ -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(" "));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user