0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-12-04 22:04:55 +01:00

Add option to print in 8bit retro style.

This commit is contained in:
Wouter R 2014-03-22 18:46:35 +01:00
parent 494aca34bc
commit 73af82a320
2 changed files with 22 additions and 0 deletions

View File

@ -38,6 +38,8 @@ function generate_gcode() {
var printerDimensionsX = settings["printer.dimensions.x"];
var printerDimensionsY = settings["printer.dimensions.y"];
var printerDimensionsZ = settings["printer.dimensions.z"];
var rasterSize = settings["doodle3d.raster.size"];
var rasterDiagonals = settings["doodle3d.raster.diagonals"];
var gCodeOffsetX = printerDimensionsX/2;
var gCodeOffsetY = printerDimensionsY/2;
@ -140,6 +142,8 @@ function generate_gcode() {
}
}
var prevPoint = null;
// loop over the subpaths (the separately drawn lines)
for (var j = 0; j < paths.length; j++) { // TODO paths > subpaths
var commands = paths[j];
@ -159,6 +163,22 @@ function generate_gcode() {
var isTraveling = !isLoop && i==0;
var doRetract = retractionEnabled && prev.distance(to) > retractionminDistance;
if (rasterSize > 0) {
to.x = (to.x / rasterSize).toFixed(0) * rasterSize;
to.y = (to.y / rasterSize).toFixed(0) * rasterSize;
}
if (prevPoint == null) prevPoint = to;
if (!rasterDiagonals) {
if (prevPoint.x != to.x && prevPoint.y != to.y) {
to.x = prevPoint.x;
i--;
}
}
prevPoint = to;
var firstPointEver = (layer == 0 && i == 0 && j == 0);
if (firstPointEver || layer > 2 && enableTraveling && isTraveling) { //always travel to first point, then disable traveling for first two layers and use settings for remainder of print
if (!firstPointEver && doRetract) gcode.push("G0 E" + (extruder - retractionamount).toFixed(3) + " F" + (retractionspeed * 60).toFixed(3)); //retract

View File

@ -113,6 +113,8 @@
<label for="heatupEnabled">Auto preheat:</label><input id="heatupEnabled" type="checkbox" name="printer.heatup.enabled" value="heatupEnabled"><br>
<label for="heatupTemperature">Preheat temperature:</label><input id="heatupTemperature" type="number" class="small" name="printer.heatup.temperature"><br>
<label for="heatupBedTemperature">Preheat bed temperature:</label><input id="heatupBedTemperature" type="number" class="small" name="printer.heatup.bed.temperature"><br>
<label for="rasterSize">Raster size:</label><input id="rasterSize" type="number" class="small" name="doodle3d.raster.size"><br>
<label for="rasterDiagonals">Allow raster diagonals:</label><input id="rasterDiagonals" type="checkbox" name="doodle3d.raster.diagonals" value="rasterDiagonals"><br>
</fieldset>
<fieldset id="doodlesettings">