update min layer time to respect min output speed

This commit is contained in:
Stewart Allen 2025-10-02 10:15:14 -04:00
commit 53a65777f8
3 changed files with 16 additions and 13 deletions

View file

@ -294,7 +294,7 @@ export const conf = {
outputLayerRetract: false, outputLayerRetract: false,
outputLoops: 0, outputLoops: 0,
outputMinLayerTime: 10, outputMinLayerTime: 10,
outputMinSpeed: 10.0, outputMinSpeed: 5.0,
outputPurgeTower: 0, outputPurgeTower: 0,
outputRaft: false, outputRaft: false,
outputRaftSpacing: 0.2, outputRaftSpacing: 0.2,

View file

@ -129,6 +129,7 @@ class Print {
close = !options.open, close = !options.open,
scarf = !poly.open ? (options.scarf ?? 0) : false, scarf = !poly.open ? (options.scarf ?? 0) : false,
tool = options.tool, tool = options.tool,
zmax = options.zmax,
last = startPoint, last = startPoint,
first = true; first = true;

View file

@ -46,8 +46,6 @@ export async function fdm_prepare(widgets, settings, update) {
output = [], output = [],
layerout = []; layerout = [];
let lastLayerStart = null;
// compute bounds if missing // compute bounds if missing
if (!bounds) { if (!bounds) {
bounds = new THREE.Box3(); bounds = new THREE.Box3();
@ -553,12 +551,9 @@ export async function fdm_prepare(widgets, settings, update) {
offset, offset,
layerout, layerout,
{ {
routeAround: process.outputAvoidGaps,
seedPoint: printPoint.sub(offset),
params, // range parameters
first: slice.index === 0, first: slice.index === 0,
support: slice.widget.support,
onBelt: beltStart, onBelt: beltStart,
params, // range parameters
pretract: (wipeDist) => { pretract: (wipeDist) => {
if (!(lastLayer && lastLayer.length)) { if (!(lastLayer && lastLayer.length)) {
return; return;
@ -573,7 +568,11 @@ export async function fdm_prepare(widgets, settings, update) {
print.addOutput(lastLayer, endpoint, null, null, lastOut.tool); print.addOutput(lastLayer, endpoint, null, null, lastOut.tool);
} }
} }
} },
routeAround: process.outputAvoidGaps,
seedPoint: printPoint.sub(offset),
support: slice.widget.support,
zmax,
} }
); );
layerout.print_time = printPoint.layer_time; layerout.print_time = printPoint.layer_time;
@ -823,8 +822,10 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
fillSpeed = opt.speed || opt.fillSpeed || (firstLayer ? firstFillSpeed || firstShellSpeed : process.outputFeedrate), fillSpeed = opt.speed || opt.fillSpeed || (firstLayer ? firstFillSpeed || firstShellSpeed : process.outputFeedrate),
infillSpeed = process.sliceFillRate || opt.infillSpeed || fillSpeed || printSpeed, infillSpeed = process.sliceFillRate || opt.infillSpeed || fillSpeed || printSpeed,
moveSpeed = process.outputSeekrate, moveSpeed = process.outputSeekrate,
minSpeed = process.outputMinSpeed,
origin = startPoint.add(offset), origin = startPoint.add(offset),
zhop = process.zHopDistance || 0, zhop = process.zHopDistance || 0,
zmax = opt.zmax,
antiBacklash = process.antiBacklash, antiBacklash = process.antiBacklash,
wipeDist = process.outputRetractWipe || 0, wipeDist = process.outputRetractWipe || 0,
isBelt = device.bedBelt, isBelt = device.bedBelt,
@ -1100,9 +1101,6 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
coast: firstLayer ? 0 : coastDist, coast: firstLayer ? 0 : coastDist,
extrude: numOrDefault(opt.extrude, shellMult), extrude: numOrDefault(opt.extrude, shellMult),
nozzleSize, nozzleSize,
rate: finishShell ? finishSpeed : printSpeed,
scarf,
tool: extruder,
onfirst: (firstPoint, preout) => { onfirst: (firstPoint, preout) => {
let from = seedPoint || startPoint; let from = seedPoint || startPoint;
if (from.distTo2D(firstPoint) > retractDist) { if (from.distTo2D(firstPoint) > retractDist) {
@ -1111,7 +1109,11 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
} }
} }
seedPoint = null; seedPoint = null;
} },
rate: finishShell ? finishSpeed : printSpeed,
scarf,
tool: extruder,
zmax
}); });
lastPoly = slice.lastPoly = poly; lastPoly = slice.lastPoly = poly;
} }
@ -1600,7 +1602,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
if (minLayerTime && tt < minLayerTime) { if (minLayerTime && tt < minLayerTime) {
let fact = tt / minLayerTime; let fact = tt / minLayerTime;
for (let p of preout) { for (let p of preout) {
if (p.emit) p.speed *= fact; if (p.emit) p.speed = Math.max(p.speed * fact, minSpeed);
} }
} }