Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcode_macro - expose math functions to gcode macros #4072

Closed

Conversation

mental405
Copy link
Collaborator

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.

@KevinOConnor
Copy link
Collaborator

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

@mental405
Copy link
Collaborator Author

mental405 commented Mar 19, 2021

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.

@mental405 mental405 closed this Mar 31, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants