jschuh / klipper-macros

A collection of useful macros for the Klipper 3D printer firmware
GNU General Public License v3.0
921 stars 167 forks source link

[BUG] _km_check_and_set_print_bounds macro fails if `MESH_MIN` or `MESH_MAX` have negative values #242

Closed HitLuca closed 5 months ago

HitLuca commented 5 months ago

I have a gcode file that has this generated PRINT_START code:

PRINT_START EXTRUDER=215 BED=60 MESH_MIN=-0.232331,0.805592 MESH_MAX=119.524,120.17 LAYERS=150 CHAMBER=0

When trying to print it I get this error

Error evaluating 'gcode_macro _km_check_and_set_print_bounds:gcode': TypeError: not all arguments converted during string formatting

Since this issue never happened to me I'm fairly certain it's the -0.232331 value in my MESH_MIN parameter which for some reason doesn't properly cast to float. I'm not sure what could be done, probably catching the error and displaying it in a more meaningful way (your mesh bounds are negative and cannot proceed) or bypass it would be nice.

Edit: re-slicing the same file but making MESH_MIN not have negative values fixes the issue, so it's very likely that's what breaks

jschuh commented 5 months ago

Should be fixed in f717812 on dev.

jschuh commented 5 months ago

Fixed on main.