z_thermal_adjust: Support toolhead positions with more than 4 axes

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2025-04-07 20:37:03 -04:00
parent 53acdfd0a5
commit 2082300309

View File

@ -110,12 +110,12 @@ class ZThermalAdjuster:
# Apply Z adjustment
new_z = pos[2] + self.z_adjust_mm
self.last_z_adjust_mm = self.z_adjust_mm
return [pos[0], pos[1], new_z, pos[3]]
return [pos[0], pos[1], new_z] + pos[3:]
def calc_unadjust(self, pos):
'Remove Z adjustment'
unadjusted_z = pos[2] - self.z_adjust_mm
return [pos[0], pos[1], unadjusted_z, pos[3]]
return [pos[0], pos[1], unadjusted_z] + pos[3:]
def get_position(self):
position = self.calc_unadjust(self.next_transform.get_position())