Copilot review fixes & upstream code interaction fix (#34)

* first pass at review issue 8
* delete detritus
* fix build compile error due to upstream changes
This commit is contained in:
Joseph Robertson
2026-05-27 21:53:04 -05:00
committed by GitHub
parent 0f75d6bc4e
commit 2dc4900292
5 changed files with 29 additions and 17 deletions
+13 -6
View File
@@ -1461,15 +1461,16 @@ bool PrintObject::invalidate_step(PrintObjectStep step)
invalidated |= this->invalidate_steps({ posPerimeters, posPrepareInfill, posInfill, posIroning, posContouring, posSupportMaterial, posSimplifyPath, posSimplifyInfill });
invalidated |= m_print->invalidate_steps({ psSkirtBrim });
m_slicing_params.valid = false;
// The exact belt_floor_z_shift is recomputed when slice() runs again.
m_belt_floor_z_shift_cache_valid = false;
} else if (step == posSupportMaterial) {
invalidated |= this->invalidate_steps({ posSimplifySupportPath });
invalidated |= m_print->invalidate_steps({ psSkirtBrim });
// NOTE: do NOT set m_slicing_params.valid = false here.
// belt_floor_z_shift is patched to an exact value during posSlice
// (PrintObjectSlice.cpp, after slice_volumes). Invalidating slicing
// params here causes update_slicing_parameters() to overwrite that
// exact value with a bounding-box approximation, while posSlice does
// not re-run to correct it — breaking belt support clipping.
// SlicingParameters depend on support config (enable_support /
// raft_layers / enforce_support_layers feed min/max layer height in
// Slicing.cpp), so invalidate them here. The vertex-scan
// belt_floor_z_shift is preserved via m_belt_floor_z_shift_cached.
m_slicing_params.valid = false;
}
// Wipe tower depends on the ordering of extruders, which in turn depends on everything.
@@ -1487,6 +1488,7 @@ bool PrintObject::invalidate_all_steps()
bool result = Inherited::invalidate_all_steps() | m_print->invalidate_all_steps();
// Then reset some of the depending values.
m_slicing_params.valid = false;
m_belt_floor_z_shift_cache_valid = false;
return result;
}
@@ -3654,6 +3656,11 @@ void PrintObject::update_slicing_parameters()
m_slicing_params.belt_floor_shear_factor = belt_floor.shear_factor;
m_slicing_params.belt_floor_from_axis = belt_floor.from_axis;
m_slicing_params.belt_floor_z_shift = belt_floor.z_shift;
// Prefer the vertex-scan z_shift over the bbox approximation when
// slice() has already produced one (e.g. this rebuild was triggered
// by a support-config change, which doesn't move the belt floor).
if (m_belt_floor_z_shift_cache_valid)
m_slicing_params.belt_floor_z_shift = m_belt_floor_z_shift_cached;
}
}