fix brims and move belt offset to export

This commit is contained in:
Stewart Allen 2021-05-01 12:48:05 -04:00
commit 3aa0df2ee4
2 changed files with 11 additions and 3 deletions

View file

@ -53,6 +53,7 @@
blast = 0,
blastz = 0,
process = settings.process,
belt_add_y = process.firstLayerYOffset || 0,
loops = process.outputLoops || 0,
zhop = process.zHopDistance || 0, // range
seekMMM = process.outputSeekrate * 60,
@ -291,7 +292,7 @@
let zheight = path ? path.height || 0 : 0;
epos.x = originCenter ? -pos.x : device.bedWidth - pos.x;
epos.z = blastz = pos.z * icos;
epos.y = -pos.y + epos.z * bcos;
epos.y = -pos.y + epos.z * bcos + belt_add_y;
lout = epos;
}
if (emit.x) o.append(" X").append(epos.x.toFixed(decimals));

View file

@ -459,9 +459,16 @@
// post-process for base extrusions (touching the bed)
if (isBelt) {
// // correct y offset to desired layer offset
let miny = process.firstLayerYOffset || 0;
let thresh = firstLayerHeight * 0.25;
let seqn = 0;
// tune base threshold
let thresh = Infinity;
for (let layer of output) {
for (let rec of layer) {
let point = rec.point;
thresh = Math.min(thresh, point.z - point.y);
}
}
thresh = thresh + firstLayerHeight * 0.25;
// iterate over layers, find extrusion on belt and
// apply corrections and add brim when specified
for (let layer of output) {