gcode_macro - expose math functions to gcode macros#4072
Conversation
|
Thanks, but I'm not sure this is a good fit for the master Klipper branch. There's a lot of stuff in the math module and I'd be concerned calling some of those functions could have adverse side-effects if called from a macro (particularly if it takes a lot of processing time). From my perspective, the intent of the macro system is really for "quick variable substitution" and not a fully programmable interface - "extras" and the "api server" are better matches for doing stuff like that. Separately, commits need to have a signed-off-by line for me to commit - see: https://github.com/KevinOConnor/klipper/blob/master/docs/CONTRIBUTING.md -Kevin |
|
what about just ceil, floor, sin, cos, tan, asin, acos, atan, fabs, fmod, trunc, pi, and e? I just did the whole math library because it was cleaner. |
Added python math lib to gcode_macro and exposed it to the templates so functions like sin and cos can be caculated from gcode macros.