fix z layer output height (manifested as first layer half height)

This commit is contained in:
Stewart Allen 2021-01-25 12:38:40 -05:00
commit 69eca2a031
2 changed files with 3 additions and 3 deletions

View file

@ -314,7 +314,7 @@
if (gcodeLayer && gcodeLayer.length) { if (gcodeLayer && gcodeLayer.length) {
appendAllSub(gcodeLayer); appendAllSub(gcodeLayer);
} else { } else {
append(`;; --- layer ${layer} (${subst.height} @ ${subst.z}) ---`); append(`;; --- layer ${layer} (${subst.height} @ ${subst.z.round(3)}) ---`);
} }
if (layer > 0 && process.outputLayerRetract) { if (layer > 0 && process.outputLayerRetract) {

View file

@ -385,7 +385,7 @@
if (layerout.length && minidx !== lastIndex) { if (layerout.length && minidx !== lastIndex) {
layerout.last().retract = true; layerout.last().retract = true;
} }
layerout.z = z; layerout.z = z + slice.height / 2;
layerout.height = layerout.height || slice.height; layerout.height = layerout.height || slice.height;
// detect extruder change and print purge block // detect extruder change and print purge block
if (!lastOut || lastOut.extruder !== slice.extruder) { if (!lastOut || lastOut.extruder !== slice.extruder) {
@ -690,7 +690,7 @@
.addPolys(moves, { thin: true, z: opts.z }); .addPolys(moves, { thin: true, z: opts.z });
// force level when present // force level when present
if (level.z) { if (level.z) {
opts.z = level.z; opts.z = level.z - height;
} }
Object.values(prints).forEach(array => { Object.values(prints).forEach(array => {
array.forEach(poly => { array.forEach(poly => {