kageurufu / preprocess_cancellation

Klipper Exclude Object Preprocessor for multiple slicers
GNU General Public License v3.0
152 stars 25 forks source link

Ignore Non Ascii characters for objects Id #13

Closed fbeauKmi closed 6 months ago

fbeauKmi commented 1 year ago

Hi, Some users on Voron Discord reported that their prints does not start when the sliced filename contains non ascii characters. Mainly, SuperSlicer is responsible because it produces output as below:

...
; object:{"name":"Dé","id":"Dé id:0 copy 0","object_center":[150.000000,150.000000,0.000000],"boundingbox_center":[150.000000,150.000000,15.000000],"boundingbox_size":[30.000000,30.000000,30.000000]}
; plater:{"center":[150.000000,150.000000,0.000000],"boundingbox_center":[150.000000,150.000000,15.000000],"boundingbox_size":[30.000000,30.000000,30.000000]}

M73 P0 R30
;TYPE:Custom
; custom gcode: start_gcode
...

I don't know yet if the other slicers behave the same.

As preprocess_cancellation uses object name as id , non-ascii characters are injected into gcode, producing klipper errors.

The solution I provide is : ignore the non ascii characters and add an ID to the string (in case of similar strings , except non-ascii)

Thanks,

kageurufu commented 6 months ago

I believe we fixed this in Klipper directly, I'm going to close this for now and if you think it's still necessary please let me know and we can re-open the issue