Skip to content

fix: Exclude raft layers from slow-down layer count#526

Open
zackaree-shen wants to merge 1 commit into
process_specificfrom
bugfix_slow_print_raft_layer_miscount
Open

fix: Exclude raft layers from slow-down layer count#526
zackaree-shen wants to merge 1 commit into
process_specificfrom
bugfix_slow_print_raft_layer_miscount

Conversation

@zackaree-shen

Copy link
Copy Markdown

Summary

Fixes a bug where slow-down layers (slow_down_layers) incorrectly counted raft layers, causing the model's actual first few layers to receive insufficient speed reduction.

Root Cause

In GCode::_extrude(), the slow-down layer lerp used raw layer_id() which includes raft layers in its counting. With 3 raft layers and slow_down_layers=5, the 3 raft layers consumed 3 slow-down slots, leaving only 2 for the actual model layers.

Fix

  • Subtract raft_layers() from layer_id() so slow-down counting starts from the first model layer
  • Change _layer > 0 to _layer >= 0 so the first model layer over raft also receives proper initial speed

Changes

File Lines
src/libslic3r/GCode.cpp +5, -2

Behavior (example: 3 raft layers + slow_down_layers=5)

Before (bug) After (fix)
Raft layers 1-2: slow-down applied Raft layers: normal speed
Model layers 1-2: slow-down (only 2 of 5) Model layers 1-5: full slow-down gradient

Verification

  • Compiled successfully with MSVC 19.44 (VS 2022)
  • Application starts and runs correctly

- Subtract raft_layers() from layer_id() so slow-down counting starts from the first model layer

- Change _layer > 0 to _layer >= 0 so the first model layer over raft also gets proper initial speed

- Ensures the model's actual first few layers receive the full slow_down_layers gradient
@zackaree-shen zackaree-shen force-pushed the bugfix_slow_print_raft_layer_miscount branch from 1299d57 to 6b6397a Compare June 22, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant