slow down shells on flats layers

This commit is contained in:
Stewart Allen 2025-09-22 19:22:03 -04:00
commit 92cfe7f2bd
2 changed files with 12 additions and 3 deletions

View file

@ -844,6 +844,11 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
fillSpeed = process.sliceSolidRate || finishSpeed;
}
// on flats layers also slow down shell print speed
if (slice.isFlatsLayer) {
printSpeed = finishSpeed || printSpeed;
}
// override: adapt bridge layer speed
if (slice.isBridgeLayer) {
fillSpeed /= 2;

View file

@ -506,6 +506,9 @@ export function fdm_slice(settings, widget, onupdate, ondone) {
let fillSpace = fillSpacing * spaceMult * solidWidth;
doSolidLayerFill(slice, fillSpace, sliceFillAngle);
}
if (slice.index === slices.length - 1) {
slice.isFlatsLayer = true;
}
if (isTopBase) {
// mark the first top solid supporting layer as a bridge
slice.isBridgeLayer = true;
@ -1378,8 +1381,9 @@ function addSolidFills(slice, polys) {
export function projectFlats(slice, count, expand) {
if (!slice.down || !slice.flats) return;
// these flats are marked for finishing print speed
if (slice.flats.length) slice.finishSolids = true;
if (slice && slice.flats && slice.flats.length) {
if (slice.flats?.length) {
slice.finishSolids = true;
slice.isFlatsLayer = true;
const flats = expand ? POLY.expand(slice.flats, expand) : slice.flats;
projectSolid(slice, flats, count, false, true);
}
@ -1391,7 +1395,7 @@ export function projectFlats(slice, count, expand) {
export function projectBridges(slice, count) {
if (!slice.up || !slice.bridges) return;
// these flats are marked for finishing print speed
if (slice.bridges.length) {
if (slice.bridges?.length) {
slice.finishSolids = true;
slice.isBridgeLayer = true;
}