nicolai-wachenschwan / arc-overhang-prusaslicer-integration

A 3D printer slicing algorithm that lets you print 90° overhangs without support material.
GNU General Public License v3.0
330 stars 26 forks source link

TypeError: unsupported operand type(s) for *: 'float' and 'NoneType' #22

Closed XenonFlits closed 1 year ago

XenonFlits commented 1 year ago

Running Prusa2.3.0 Error I get is

Error code: 1
Output:
Traceback (most recent call last):
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 1179, in <module>
main(gCodeFileStream,path2GCode, skipInput)
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 109, in main
parameters=makeFullSettingDict(gCodeSettingDict)
File "/home/pi/Documents/3Dprinting/postprocessing/NoOverhang.py", line 58, in makeFullSettingDict
"ExtendIntoPerimeter":1.5*gCodeSettingDict.get("perimeter_extrusion_width"), #min=0.5extrusionwidth!, extends the Area for arc generation, put higher to go through small passages. Unit:mm
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

Header of print file (gcode file) is:

; generated by PrusaSlicer 2.3.0 on 2023-03-20 at 19:39:36 UTC

; 

; external perimeters extrusion width = 0.45mm
; perimeters extrusion width = 0.45mm
; infill extrusion width = 0.45mm
; solid infill extrusion width = 0.45mm
; top infill extrusion width = 0.40mm
; first layer extrusion width = 0.42mm

M107
M190 S50 ; set bed temperature and wait for it to be reached
M104 S220 ; set temperature
;TYPE:Custom
START_PRINT
M109 S220 ; set temperature and wait for it to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for ...
etc etc

What is the problem? Is it a bug? Or do I have to correct a Prusa setting?

maruhe commented 1 year ago

at the end of the gcode-file Pruse should add all settings - it should look like this: ; prusaslicer_config = begin ; avoid_crossing_curled_overhangs = 1 ; avoid_crossing_perimeters = 0 ; avoid_crossing_perimeters_max_detour = 0 ; bed_custom_model = ; bed_custom_texture = ; bed_shape = 0x0,350x0,350x350,0x350 ; bed_temperature = 100 ...

perimeter_extrusion_width is the first setting the script tries to find if the settings-section is missing at the end of you gcode-file find our why or try a newer version of PrusaSlicer (it works fine here with 2.6 alpha 5)

nicolai-wachenschwan commented 1 year ago

Thank you @maruhe, could not tell it better :)

lkera commented 1 year ago

had the same issue because i was using superslicer, i had to change '' ; superslicer_config = begin'' to ''; prusaslicer_config = begin''

maruhe commented 1 year ago

@nicolai-wachenschwan we thank you, have been waiting for long time ;-)

if you may integrate to also read ; superslicer_config = begin pls also add the end of settings - if other plugins add Text at the end there comes a lot of output from your script

for line in gcodeLines:
    if "; prusaslicer_config = begin" in line:
        isSetting=True
        continue
    if "; prusaslicer_config = end" in line:
        isSetting=False
        continue
nicolai-wachenschwan commented 1 year ago

updated the code, would be happy, if you could test it with superslicer