aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorvoidtrance <30448940+voidtrance@users.noreply.github.com>2024-05-15 18:38:42 -0700
committerGitHub <noreply@github.com>2024-05-15 21:38:42 -0400
commit694d38c79105f2d33242487faa0532d1291ee7b6 (patch)
treef95c192ac3f83ebd735abd039987e9ce38e96134 /klippy
parentdae8b8cacff583b180c650d9a6d1601907a12f1e (diff)
downloadkutter-694d38c79105f2d33242487faa0532d1291ee7b6.tar.gz
kutter-694d38c79105f2d33242487faa0532d1291ee7b6.tar.xz
kutter-694d38c79105f2d33242487faa0532d1291ee7b6.zip
bed_mesh: Fix adaptive probe count on delta printers (#6600)
Round beds require an odd number of probe points in order to prevent erroneously truncating the mesh. The adaptive mesh algorithm did not consider that and as a result, it was possible to generate adaptive meshes with even number of probe points. This change fixes this by increasing the probe point count by 1 in cases where the adaptive probe points are even. Signed-off-by: Mitko Haralanov <voidtrance@gmail.com>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/bed_mesh.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index 87f2324a..095ccf1f 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -652,8 +652,11 @@ class BedMeshCalibrate:
self.origin = adapted_origin
self.mesh_min = (-self.radius, -self.radius)
self.mesh_max = (self.radius, self.radius)
+ new_probe_count = max(new_x_probe_count, new_y_probe_count)
+ # Adaptive meshes require odd number of points
+ new_probe_count += 1 - (new_probe_count % 2)
self.mesh_config["x_count"] = self.mesh_config["y_count"] = \
- max(new_x_probe_count, new_y_probe_count)
+ new_probe_count
else:
self.mesh_min = adjusted_mesh_min
self.mesh_max = adjusted_mesh_max