From 7dcb74e5041c9dc68690c82cb2561488e086637f Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Sat, 25 Apr 2026 00:32:42 -0400 Subject: [PATCH] docs(imex): document inputs of build_imex_cache_key The IMEX zone cache key drives ghost rebuild and zone-overlay invalidation. Adding a printer config option that affects zone geometry, ghost transforms, or collision strips without extending the key produces a silent staleness bug: the cache thinks the zones are still valid and ghost meshes / overlays don't refresh after the new option changes. Document what currently feeds the key and pin the precision convention (*10 scale on float values for 0.1 mm resolution) so future contributors know the contract and where to extend it. Co-Authored-By: Claude Opus 4.7 --- src/slic3r/GUI/PartPlate.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 6ddc4b4811..1e08000f82 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -909,6 +909,18 @@ void PartPlate::calc_imex_zones() // Build a cache key from the current IDEX/IQEX config options, or "" if IDEX/IQEX is off. // Reads per-plate mode from m_config first, falling back to the process preset. +// +// Inputs that contribute to the key (any change must invalidate the IMEX zone cache): +// - active_mode (per-plate or process-preset fallback) +// - imex_tools_per_gantry, imex_gantry_count (grid shape) +// - imex_nozzle_clearance_x, imex_nozzle_clearance_y (zone widths / collision strips) +// - imex_carriage_margin (zone shrink) +// +// IMPORTANT: if you add a printer config option that affects zone geometry, ghost transforms, +// or collision strips, it MUST be incorporated here — otherwise ghost meshes and zone overlays +// will go stale silently after a config change. Float values are scaled by 10 before integer +// cast so 0.1 mm steps invalidate the cache; if you add a float option needing finer precision, +// adjust the scale. std::string PartPlate::build_imex_cache_key() const { if (!wxGetApp().preset_bundle)