From d0c6e8305d7af2f85b63ed0ba0141001d71219e2 Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Mon, 8 Jun 2026 01:24:35 -0400 Subject: [PATCH] fix(imex): hide secondary carriages in g-code preview when firmware-managed-zones is on The firmware-managed-zones writer offset centers the slice at bed origin, so prim_pos and the preview toolpaths sit in a shifted frame relative to the plate-local bed bounds the secondary-marker zone math uses. Computing secondaries against unshifted bed bounds puts them off the build plate. Skip the secondary-marker / toolhead-box computation when the firmware-managed-zones option is enabled. The firmware physically fans the centered toolpath out into the zones at print time, so the honest preview is the single centered toolpath with no secondaries. Reported by @Felix14-v2 on PR #13086. --- src/slic3r/GUI/GCodeViewer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 6d59a022bf..93260e0fa2 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1644,7 +1644,16 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin) m_imex_last_mode = mode; } - if (!mode.empty() && mode != kImexPrimaryMode) { + // Firmware-managed-zones centers the slice at bed origin, so prim_pos + // and the preview toolpaths sit in a shifted frame relative to the + // plate-local bed bounds the zone math uses. Computing secondaries here + // would place them off-bed. The firmware physically fans the centered + // toolpath out into the zones, so the centered preview with no + // secondaries is the honest representation. + auto* fw_opt = printer_cfg.opt("imex_firmware_managed_zones"); + const bool firmware_managed = fw_opt && fw_opt->value; + + if (!firmware_managed && !mode.empty() && mode != kImexPrimaryMode) { auto* mode_names_opt = printer_cfg.opt("imex_mode_names"); auto* active_tools_opt = printer_cfg.opt("imex_mode_active_tools");