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

Flashforge Thumbnail to Prusaslicer idea. #2

Open
KeltE opened this issue Feb 1, 2021 · 6 comments
Open

Flashforge Thumbnail to Prusaslicer idea. #2

KeltE opened this issue Feb 1, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@KeltE
Copy link

KeltE commented Feb 1, 2021

Hello!
i am very ignorant of codes. Since I am using Prusaslicer on Flashforge Dreamer NX, the idea came to mind. Post-processing scripts can be added in Prusaslicer. Is there any way to customize your Cura plugin so that the script takes the same thumbnail and simply adds Gcode to the beginning when saving? And the .GX end can be added to the "Output fileneame format" line.
Best regards Egon

@ronoaldo
Copy link
Owner

ronoaldo commented Feb 1, 2021

Hello @KeltE - yes, it could!

I'm not familiar yet with PrusaSlicer coding, but I attempted to make the code here modular, in order to allow these use cases.

I can tune the code that generates .gx file to take the image as input. Does Prusaslicer provides some way to export the current view as an image file and pass this data to the post-processing script?

We can try to coordinate with PrusaSlicer maintainers in order to make this use case possible. I find it very, very useful to be able to preview the gcode somehow and the embedded image makes a big difference i usage.

@ronoaldo ronoaldo added the enhancement New feature or request label Feb 1, 2021
@KeltE
Copy link
Author

KeltE commented Feb 1, 2021

As I understand it, Prusaslicer generates a thumbnail inside the G code. All you have to do is set the desired size in the Printer settings> General> G-code Tumbnail box. https://forum.prusaprinters.org/forum/original-prusa-i3-mk3s-mk3-hardware-firmware-and-software-help/way-to-enable-prusaslicer-thumbnails-for-mk3s/
In the beginning, if I didn't know that Marlin flavor was running on Dreamer Nx, I used the Perl script found on Uptimfab.com to replace the wrong warm-up commands.
In Prusaslicer you can set the G code output format you want. In principle, it is not even necessary to make the .GX format separately. If you could only get a thumbnail with Script at the beginning of the program.
Prusaslicer print settings_output options

https://forum.duet3d.com/topic/18342/paneldue-image-display/9
I found such a discussion. Prusaslicer seems to make Base64 code from a PNG image.

@ronoaldo
Copy link
Owner

ronoaldo commented Feb 2, 2021

I can take a look at how that works out, but if the image is already embedded then the python script will be able to convert from base 64 to the .gx binary header.

@KeltE
Copy link
Author

KeltE commented Feb 2, 2021

Thank you very much!

@ronoaldo
Copy link
Owner

ronoaldo commented Feb 2, 2021

For the record, there are issues with Prusa printers, and it makes more sense on why Flashforge picked a binary, one-line, grayscale BMP. Anyway, based on the comments from @KeltE and the discussion here, it should be doable: prusa3d/PrusaSlicer#4127

@KeltE
Copy link
Author

KeltE commented Feb 3, 2021

I will add a Gcode to a cube made with one Prusaslicer. You mentioned in the plugin data that the thumbnail size is 80x60. At the beginning of the G code is a thumbnail generated by Prusaslicer. Maybe it will help.
xyzCalibration_cube_0.2mm_PLA_44m.txt

@ronoaldo ronoaldo self-assigned this Aug 17, 2022
@ronoaldo ronoaldo added this to the Version 2.4 milestone Mar 21, 2023
ronoaldo added a commit that referenced this issue Apr 7, 2024
The start gcode macros in recent versions of Cura
format the print temperature as a floating point.
Other temperature commands in the gcode don't have
such behavior.

On Finder (version 1?) with the more recent firmware, this
causes the temperature to be the fixed to start at 185C,
which appears to be the "default start temperature" or some
rounding error when reading the floating point temperature.

This commit fixes that by parsing the 'M104 SXXX' commands,
and changing the temperature by converting it to integer.
This also allows the temperature to be embedded to the .gx
file header.

I took the opportunity to move the parsing commands into the
gx.py script, as a way to potentially easy the proccess to
make this a standalone script that can potentially be used
by other slicers/software.

Fixes #21
Related to #2 and #16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants