aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bed_mesh.py
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2019-02-12 19:50:10 -0500
committerKevinOConnor <kevin@koconnor.net>2019-02-25 13:34:14 -0500
commitf7d885458759484cdebbeaddb240811507ed947c (patch)
tree422b7bacc3f7280a0dcb376533a381dc39ac83f9 /klippy/extras/bed_mesh.py
parent7694c3e1b8c374a8d7c84685ff72f9edf3a23e16 (diff)
downloadkutter-f7d885458759484cdebbeaddb240811507ed947c.tar.gz
kutter-f7d885458759484cdebbeaddb240811507ed947c.tar.xz
kutter-f7d885458759484cdebbeaddb240811507ed947c.zip
bed_mesh: simplify configuration
The 'bed_shape' option has been removed. The user will enter a 'bed_radius' if they have a round be, otherwise they should enter 'min_point' and 'max_point'. When the bed is round the user should supply a 'round_probe_count' option, otherwise just 'probe_count'. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras/bed_mesh.py')
-rw-r--r--klippy/extras/bed_mesh.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index 3d606004..506d5aa1 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -10,8 +10,6 @@ import json
import probe
import collections
-BED_SHAPES = {'rectangular': 0, 'round': 1}
-
class BedMeshError(Exception):
pass
@@ -210,14 +208,13 @@ class BedMeshCalibrate:
'BED_MESH_PROFILE', self.cmd_BED_MESH_PROFILE,
desc=self.cmd_BED_MESH_PROFILE_help)
def _generate_points(self, config):
- shape = config.getchoice('bed_shape', BED_SHAPES, 'rectangular')
- if shape == BED_SHAPES['round']:
- x_cnt = y_cnt = config.getint('probe_count', 5)
+ self.radius = config.getfloat('bed_radius', None, above=0.)
+ if self.radius is not None:
+ x_cnt = y_cnt = config.getint('round_probe_count', 5, minval=3)
# round beds must have an odd number of points along each axis
if not x_cnt & 1:
raise config.error(
"bed_mesh: probe_count must be odd for round beds")
- self.radius = config.getfloat('radius', above=0.)
# radius may have precision to .1mm
self.radius = math.floor(self.radius * 10) / 10
min_x = min_y = -self.radius