0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

Merge branches 'master' and 'master' of https://github.com/Doodle3D/doodle3d-client

# By peteruithoven
# Via peteruithoven
* 'master' of https://github.com/Doodle3D/doodle3d-client:
  objectHeight and twist fix and temp display fix

# By peteruithoven
# Via peteruithoven
* 'master' of https://github.com/Doodle3D/doodle3d-client:
  objectHeight and twist fix and temp display fix
This commit is contained in:
Adriaan Wormgoor 2013-09-18 17:16:23 +02:00
commit d610e802f5
2 changed files with 19 additions and 10 deletions

View File

@ -106,6 +106,8 @@ function Printer() {
return; return;
} }
this.targetTemperature = settings["printer.temperature"]; // slight hack
this.sendPrintPart(this.sendIndex, this.sendLength); this.sendPrintPart(this.sendIndex, this.sendLength);
} }
this.byteSize = function(s){ this.byteSize = function(s){
@ -139,6 +141,7 @@ function Printer() {
if (lastOne) { if (lastOne) {
console.log("Printer:sendPrintPart:gcode sending completed"); console.log("Printer:sendPrintPart:gcode sending completed");
this.gcode = []; this.gcode = [];
self.targetTemperature = settings["printer.temperature"]; // slight hack
} else { } else {
self.sendPrintPart(sendIndex + sendLength, sendLength); self.sendPrintPart(sendIndex + sendLength, sendLength);
} }

View File

@ -90,9 +90,19 @@ function generate_gcode(callback) {
console.log(""); console.log("");
//*/ //*/
objectHeight = Math.ceil(numLayers / 5); // in settings objectHeight = 20, in previewRendering_v01.js numLayers is 100, hence the / 5 // max amount of real world layers
objectHeight = numLayers; // in settings objectHeight = 20, in previewRendering_v01.js numLayers is 100, hence the / 5 var layers = maxObjectHeight / layerHeight; //maxObjectHeight instead of objectHeight
// translate numLayers in preview to objectHeight in real world
//objectHeight = Math.ceil(numLayers / 5); // in settings objectHeight = 20, in previewRendering_v01.js numLayers is 100, hence the / 5
//objectHeight = numLayers; // in settings objectHeight = 20, in previewRendering_v01.js numLayers is 100, hence the / 5
objectHeight = Math.round(numLayers/maxNumLayers*maxObjectHeight);
// translate preview rotation (per layer) to real world rotation
var rStepGCode = rStep * maxNumLayers/layers; ///maxNumLayers*maxObjectHeight;
// correct direction
rStepGCode = -rStepGCode;
// todo hier een array van PATHS maken wat de losse paths zijn // todo hier een array van PATHS maken wat de losse paths zijn
// copy array without reference -> http://stackoverflow.com/questions/9885821/copying-of-an-array-of-objects-to-another-array-without-object-reference-in-java // copy array without reference -> http://stackoverflow.com/questions/9885821/copying-of-an-array-of-objects-to-another-array-without-object-reference-in-java
@ -109,8 +119,7 @@ function generate_gcode(callback) {
gcode = gcode.concat(startGcode); gcode = gcode.concat(startGcode);
//gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it //gcode.push("M109 S" + temperature); // set target temperature and wait for the extruder to reach it
var layers = maxObjectHeight / layerHeight; //maxObjectHeight instead of objectHeight
var extruder = 0.0; var extruder = 0.0;
var prev = new Point(); prev.set(0, 0); var prev = new Point(); prev.set(0, 0);
@ -146,10 +155,9 @@ function generate_gcode(callback) {
// sort-of in de buurt van (360/2.5) // sort-of in de buurt van (360/2.5)
// // -> aight.. er zijn 750 lines vs 1000 in de d3d app. 135 = .75 * 180... dit kan je nog rechttrekken als je NET wat slimmer nadenkt :) // // -> aight.. er zijn 750 lines vs 1000 in de d3d app. 135 = .75 * 180... dit kan je nog rechttrekken als je NET wat slimmer nadenkt :)
// update: NEE, het is niet .75 * 180 want 135 was niet de beste value. //TODO dus. // update: NEE, het is niet .75 * 180 want 135 was niet de beste value.
var radToDeg = 180/Math.PI; //pointsRotate(p, rStep * progress * 139);
pointsRotate(p, (rStep * radToDeg) * -progress); pointsRotate(p, rStepGCode * layer);
// pointsRotate(p, rStep * -progress * 139);
if (layer == 0) { if (layer == 0) {
//gcode.push("M107"); //fan off //gcode.push("M107"); //fan off
@ -226,8 +234,6 @@ function generate_gcode(callback) {
console.log("f:generategcode() >> (layer/layers) > (objectHeight/maxObjectHeight) is true -> breaking at layer " + (layer + 1)); console.log("f:generategcode() >> (layer/layers) > (objectHeight/maxObjectHeight) is true -> breaking at layer " + (layer + 1));
break; break;
} }
} }
// add gcode end commands // add gcode end commands