mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-10 16:27:55 -06:00
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>
This commit is contained in:
parent
7694c3e1b8
commit
f7d8854587
3 changed files with 28 additions and 31 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue