fix laser output for centering

This commit is contained in:
Stewart Allen 2019-05-24 14:15:54 -04:00
commit 6e71caae04
2 changed files with 17 additions and 2 deletions

View file

@ -186,8 +186,8 @@ var gs_kiri_laser = exports;
});
});
// normalize against origin lower left
if (!process.outputOriginCenter) {
// normalize against origin lower left
output.forEach(function(layer) {
layer.forEach(function(out) {
point = out.point;
@ -199,6 +199,21 @@ var gs_kiri_laser = exports;
max.y = max.y - min.y;
min.x = 0;
min.y = 0;
} else {
// normalize against center of build area
let w = print.settings.device.bedWidth;
let h = print.settings.device.bedDepth;
output.forEach(function(layer) {
layer.forEach(function(out) {
point = out.point;
point.x += w/2;
point.y += h/2;
});
});
max.x = w;
max.y = h;
min.x = 0;
min.y = 0;
}
onpre(min, max, process.outputLaserPower, process.outputLaserSpeed);