slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.27k stars 1.29k forks source link

Add printer / print settings profile to .gcode header comments #5148

Closed smartin015 closed 1 year ago

smartin015 commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm the maintainer of the Continuous Print Queue plugin for Octoprint, which has features requiring an understanding of the printer for which a gcode file is sliced (see docs). In particular, this is necessary for cluster/network printing when the type of printer on the network varies.

I'm intend to add profile inference for the most popular slicers, but Slic3r has no way to examine the gcode and infer the printer to print the file with. I can contribute a PR to add this as a file comment (e.g. ; printer_profile = "CR-20") but I wanted to file an issue first in case discussion was needed before I got started.

Describe the solution you'd like

A string like ; printer_profile = "CR-20" is present in gcode, matching the name of the printer profile being used to slice the file.

Describe alternatives you've considered

Infer a compatible printer name from implicit details (e.g. build volume) but that's very brittle.

Additional context

I made a similar request to Cura: https://github.com/Ultimaker/Cura/issues/14283

However, I'm not familiar with perl scripts and need more pointers if I were to help contribute something here.

smartin015 commented 1 year ago

Hey, could I get a weigh-in on making this GCODE header addition so folks can identify the printer targeted by a gcode file? I intend to learn perl for advent of code this year, would be great to put that to use here :)

smartin015 commented 1 year ago

Friendly ping?

xoan commented 1 year ago

There is a "Notes" field in Printer Settings where anyone can put anything you want, like:

; printer_profile = "Awesome RepRap Printer"

I think It should work in the manner you want.

smartin015 commented 1 year ago

Ok, thanks - I suppose a little manual configuration is fine for the (probably small) subset of folks who use CPQ with slic3r gcode flies.