Retract for a toolchange on Hilbert curve surfaces

The rule that skips the retraction on Hilbert curve surfaces also
skipped the retraction for a toolchange, which GCode::set_extruder()
asks for without a role. On a first layer with Hilbert curve bottom
surfaces and no wipe, a toolchange then happened without any
retraction. Keep the skip for travels only.
This commit is contained in:
Ian Bassi committed 2026-11-30 14:27:08 -03:00
1 parent f74888580f
commit fbb75de586
2 files changed
+40 -2

No files matched your search

+2 -2
View File
@@ -10983,8 +10983,8 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li
(the extruder might be already retracted fully or partially). We call these
methods even if we performed wipe, since this will ensure the entire retraction
length is honored in case wipe path was too short. */
// Hilbert curve surfaces skip the retraction, but not the rest of one a wipe has started.
if (wiped ||
// Hilbert curve surfaces skip the retraction of a travel, but not a toolchange's, nor the rest of one a wipe has started.
if (wiped || toolchange ||
((!this->on_first_layer() || this->config().bottom_surface_pattern != InfillPattern::ipHilbertCurve) &&
(role != erTopSolidInfill || this->config().top_surface_pattern != InfillPattern::ipHilbertCurve)))
gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract();