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

GcodeStartEndFormatter with basic math functions #11452

Open
MarcelMo opened this issue Feb 9, 2022 · 11 comments
Open

GcodeStartEndFormatter with basic math functions #11452

MarcelMo opened this issue Feb 9, 2022 · 11 comments
Labels
Status: Deferred We don't have time to work on this for now but intend to in the future. Status: Triage This ticket requires input from someone of the Cura team Type: New Feature Adding some entirely new functionality.

Comments

@MarcelMo
Copy link

MarcelMo commented Feb 9, 2022

Is your feature request related to a problem?

A good start/stop script should be parametric, but since even the simplest scripts need unit conversions (travel speed for example), there is no "one for all" script possible.

Describe the solution you'd like

GcodeStartEndFormatter should be able to perform at least some basic math functions, and also, should be able to parse the most basic syntax conventions.
My guess, best way would be to define some basic allowed functions and operators.
Functions like sqrt(),pow() and operators like "+","-" and "("/")"
I never used python, so I don't know what kind of evaluation would be safest.

Describe alternatives you've considered

Alternatively I would suggest allowing the whole script to be python, and generating the complete gcode via script.
Or maybe there is some sort of plugin for that already ?

Affected users and/or printers

All users would benefit from universal adapting default scripts.

Additional information & file uploads

No response

@MarcelMo MarcelMo added the Type: New Feature Adding some entirely new functionality. label Feb 9, 2022
@fvrmr
Copy link
Contributor

fvrmr commented Feb 11, 2022

Hi @MarcelMo thank you for your feature request.
I will bring this up for discussion with the team. Keep you posted.

@Ghostkeeper
Copy link
Collaborator

Possibly a duplicate of #6701 or #9906.

@MarcelMo
Copy link
Author

MarcelMo commented Feb 15, 2022

Possibly a duplicate of #6701 or #9906.

Yes, the error reporting as mentioned should also be adressed. The whole parsing stops on a single error. All other lines should be processed. Maybe the error can simply be added as a comment in the resulting gcode. Or maybe it is even possible to highlight any errors while editing. Also, while editing a suggestion on all possible variables would be really great (maybe even containing the human readable description of the variable and/or its source).

@fvrmr
Copy link
Contributor

fvrmr commented Feb 18, 2022

We have discussed it with the team and we decided to defer this issue, like the other two.
It will not get a high priority for us to implement. I hope you understand.

@fvrmr fvrmr added the Status: Deferred We don't have time to work on this for now but intend to in the future. label Feb 18, 2022
@MarcelMo
Copy link
Author

How about using an existing template engine ? As a php programmer I would think of something like smarty or twig. This should be fairly easy to implement and would circumvent the need to do a lot of coding and documenting.

@fvrmr
Copy link
Contributor

fvrmr commented Feb 18, 2022

You are free to implement this yourself and create a pull request :)
We have a backlog full with other more important things to work on and don't expect this to get a high priority on our backlog, but as you can see in the other threads people would like to do this as well.

@fieldOfView
Copy link
Collaborator

I must say that I like the idea of using an existing template engine. In Python, you could use eg Jinja or Mako instead of Twig.

The problem remains though that much of the decisions of eg which extruders are actually used, and which s used as the first extruder, are made in CuraEngine, not in the Python-based frontend that deals with the start and end gcode formatting.

@MarcelMo
Copy link
Author

I search the web a bit.
The coding itself is not the problem. I just don't know about, dependencies, policies, compatibility and configuration options - if needed to switch usage of the engine.
I would need something like jinja2 added to the dependencies and policies, but have no clue how this project handles such a thing. The syntax is slightly different. But usage is simple and straight forward.

@Ghostkeeper
Copy link
Collaborator

Cura's dependencies are in the cura-build-environment repository. In particular, the Python modules we depend on are in the requirements.txt file there.

We'd also have to ensure that existing configurations keep working in Cura. So if the syntax is different and not backwards compatible, that would be a problem. A version upgrade would need to handle that then.

@github-actions
Copy link
Contributor

Hi 👋,
We are cleaning our list of issues to improve our focus.
This feature request seems to be older than a year, which is at least three major Cura releases ago.
It also received the label Deferred indicating that we did not have time to work on it back then and haven't found time to work on it since.

If this is still something that you think can improve how you and others use Cura, can you please leave a comment?
We will have a fresh set of eyes to look at it.

If it has been resolved or don't need it to be improved anymore, you don't have to do anything, and this issue will be automatically closed in 14 days.

@github-actions github-actions bot added the Status: Stale ⌛ This issue is over a year old. It might be obsolete or just needs a fresh set of eyes label Jun 29, 2023
@MarcelMo
Copy link
Author

Bump

@github-actions github-actions bot added Status: Triage This ticket requires input from someone of the Cura team and removed Status: Stale ⌛ This issue is over a year old. It might be obsolete or just needs a fresh set of eyes labels Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Deferred We don't have time to work on this for now but intend to in the future. Status: Triage This ticket requires input from someone of the Cura team Type: New Feature Adding some entirely new functionality.
Projects
None yet
Development

No branches or pull requests

4 participants