Extra length on restart GUI Bug
Agent answer
Triage: Issue #18044 — "Extra length on restart" applied when retraction disabled
Verdict: reproducible bug (triaged). The reporter's claim is correct and traceable in source; it is OS-independent and reproducible on Linux via the CLI slicer or a small unit test.
Reasoning
- With
retraction_length = 0the GUI disablesretract_restart_extra(src/slic3r/GUI/Tab.cpp:7029-7034) but keeps the stored value. GCode::needs_retraction()(src/libslic3r/GCode.cpp:10852) only checks travel length / leaving-external-perimeter / overhang — it does not bail out whenretraction_length == 0, so the retract path still executes.- In
Extruder::retract()(src/libslic3r/Extruder.cpp:93-120),m_restart_extra = restart_extrais assigned outside theif (to_retract > 0.)guard (line 112; same bug in the shared-extruder branch at line 100). With length 0,to_retract = 0, no retract G-code is emitted, butm_restart_extrais still cached. - The next
Extruder::unretract()(src/libslic3r/Extruder.cpp:132) computesdE = m_retracted(0) + m_restart_extra(>0), soGCodeWriter::unretract()(src/libslic3r/GCodeWriter.cpp:1524) emits a genuine extrusion move — over-extrusion despite retraction being "disabled". This matches the reporter's suggested fix direction (move the assignment inside theif, plus mirror handling so restart_extra is not carried when no retraction happened).
How to reproduce on this Linux machine
- CLI: slice a tiny model (e.g. a small cube with internal travels) with
retraction_length=0,retract_restart_extra=5(and defaultretraction_minimum_travel), then grep the output G-code for unexpected extrusion (G1 E...) on the first move after a travel/restart — over-extrusion moves of ~restart-extra length should appear. - Unit test: construct an
Extruder, callretract(0, 5)thenunretract(); current code returnsdE == 5instead of0.
Area / platform
- Area: gcode (retraction/restart extrusion in
Extruder/GCodeWriter/GCode). - Platform: all (logic is OS-independent; reported on Linux/Debian).
Cause
Root cause: Extruder::retract() stores m_restart_extra unconditionally, outside the to_retract > 0 guard (src/libslic3r/Extruder.cpp:112 and the shared-extruder branch at line 100). GCode::needs_retraction() (src/libslic3r/GCode.cpp:10852) does not gate on retraction_length==0, so the retract path still runs with length 0 (to_retract=0, nothing emitted) yet caches restart_extra; the following Extruder::unretract() (src/libslic3r/Extruder.cpp:132) then emits dE = 0 + restart_extra > 0. The GUI merely disables the field (src/slic3r/GUI/Tab.cpp:7029-7034) without clearing the value.
Triage summary
When retraction length is 0 (retraction "disabled"), the GUI disables the "Extra length on restart" field but the stored value is still applied during slicing, emitting an extra unretract extrusion (over-extrusion) on travel/restart moves.
Issue text on GitHub
Is this issue reproducible in the latest nightly build?
- [x] I have checked the latest nightly build and the issue is still reproducible
Is there an existing issue for this problem?
- [x] I have searched the existing issues
OrcaSlicer Version
2.5.2
Regression compared to a previous version
No response
Operating System (OS)
Linux
OS Version
Debian
Additional system information
No response
Printer
custom
How to reproduce
Enable in Printersettings retract and set Extra length on restart
if i set retract to 0 to dissable, Extra length on restart input feld is disabled but my last value is sored and is used by the slicing process
for my understanind if a input field is disabeld for me the function is disabeld but here i only cant change
src/libslic3r/Extruder.cpp
93: double Extruder::retract(double length, double restart_extra) … 111: double to_retract = std::max(0., length - m_retracted); 112: m_restart_extra = restart_extra; // ← **needs do go 2 lines bot in the if part?** 113: if (to_retract > 0.) { 114: m_E -= to_retract; 115: m_absolute_E -= to_retract; 116: m_retracted += to_retract; 117: }
Actual results
disabled but slicer calculate the extra distance
Expected results
if the field is disabled the function should ignored by the slicer for my understanding
Project file & Debug log uploads
Checklist of files to include
- [ ] Log file
- [ ] Project file
Anything else?
No response
- Area
- gcode
- Platform
- all
- Author
- cantcode89
- Comments
- 3
- Created
- 2026-11-30
Log
- vast-tw restarted; returned to the queuevast-tw · 1 h ago
- vast-tw took it: reproducevast-tw · 1 h ago
- triage: triagedvast-tw · 1 h ago
- vast-tw took it: triagevast-tw · 1 h ago
- Collected from GitHubpanel · 3 h ago