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 <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-04-25 00:32:42 -04:00
co-authored by Claude Opus 4.7
parent 4e0a2704b9
commit 7dcb74e504
+12
View File
@@ -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)