optimize belt print starting points

This commit is contained in:
Stewart Allen 2021-01-11 19:14:07 -05:00
commit 26de2710bd
2 changed files with 14 additions and 4 deletions

View file

@ -424,9 +424,10 @@
preout = [], preout = [],
scope = this, scope = this,
settings = this.settings, settings = this.settings,
device = settings.device,
process = settings.process, process = settings.process,
extruder = slice.extruder || 0, extruder = slice.extruder || 0,
nozzleSize = settings.device.extruders[extruder].extNozzle, nozzleSize = device.extruders[extruder].extNozzle,
firstLayer = opt.first || false, firstLayer = opt.first || false,
minSeek = nozzleSize * (opt.minSeek || 1.5), minSeek = nozzleSize * (opt.minSeek || 1.5),
thinWall = nozzleSize * (opt.thinWall || 1.75), thinWall = nozzleSize * (opt.thinWall || 1.75),
@ -447,6 +448,8 @@
zhop = process.zHopDistance || 0, zhop = process.zHopDistance || 0,
antiBacklash = process.antiBacklash, antiBacklash = process.antiBacklash,
doSupport = opt.support, doSupport = opt.support,
isBelt = device.bedBelt,
startClone = startPoint.clone(),
z = slice.z; z = slice.z;
// apply first layer extrusion multipliers // apply first layer extrusion multipliers
@ -747,6 +750,11 @@
break; break;
} }
// optimize start point on belt for all tops
if (isBelt) {
startPoint = startClone;
}
// top object // top object
let bounds = POLY.flatten(next.shellsAtDepth(0).clone(true)); let bounds = POLY.flatten(next.shellsAtDepth(0).clone(true));

View file

@ -371,10 +371,11 @@
printPoint = purge(slice.extruder, track, layerout, printPoint, slice.z); printPoint = purge(slice.extruder, track, layerout, printPoint, slice.z);
} }
let tmpout = []; let tmpout = [];
let wtb = slice.widget.track.box;
// output seek to start point between mesh slices if previous data // output seek to start point between mesh slices if previous data
printPoint = print.slicePrintPath( printPoint = print.slicePrintPath(
slice, slice,
printPoint.sub(offset), isBelt ? newPoint(-wtb.w, wtb.d * 2, 0) : printPoint.sub(offset),
offset, offset,
tmpout, //layerout, tmpout, //layerout,
{ {
@ -408,10 +409,11 @@
let y = maxy; let y = maxy;
let z = minz; let z = minz;
let b = Math.max(firstLayerBrim, 1); let b = Math.max(firstLayerBrim, 1);
print.addOutput(layerout, newPoint(minx - b, y, z), 0, firstLayerSeek, tool);
print.addOutput(layerout, newPoint(minx - 0, y, z), emit, firstLayerRate, tool);
print.addOutput(layerout, newPoint(maxx + b, y, z), 0, firstLayerSeek, tool); print.addOutput(layerout, newPoint(maxx + b, y, z), 0, firstLayerSeek, tool);
print.addOutput(layerout, newPoint(maxx + 0, y, z), emit, firstLayerRate, tool); print.addOutput(layerout, newPoint(maxx + 0, y, z), emit, firstLayerRate, tool);
print.addOutput(layerout, newPoint(minx - b, y, z), 0, firstLayerSeek, tool);
print.addOutput(layerout, newPoint(minx - 0, y, z), emit, firstLayerRate, tool);
// print.addOutput(layerout, newPoint(minx - 0, y, z + 5), 0, firstLayerRate, tool);
} }
} }
layerout.appendAll(tmpout); layerout.appendAll(tmpout);