FlashforgeFinderIntegration icon indicating copy to clipboard operation
FlashforgeFinderIntegration copied to clipboard

Flashforge Thumbnail to Prusaslicer idea.

Open KeltE opened this issue 4 years ago • 6 comments

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

KeltE avatar Feb 01 '21 09:02 KeltE

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 avatar Feb 01 '21 13:02 ronoaldo

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.

KeltE avatar Feb 01 '21 21:02 KeltE

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.

ronoaldo avatar Feb 02 '21 10:02 ronoaldo

Thank you very much!

KeltE avatar Feb 02 '21 10:02 KeltE

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: https://github.com/prusa3d/PrusaSlicer/issues/4127

ronoaldo avatar Feb 02 '21 17:02 ronoaldo

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

KeltE avatar Feb 03 '21 08:02 KeltE