hello,
Thank you for your answer. So the goal of my company is to create a new way to create industrial metal pieces by using 3d printing firstly to create the piece in plastic and with this plastic piece create a mold in which aluminium is poured and melt the plastic (so we need a 3d printing with the lowest density, so all the plastic will be burn by the aluminium. I am currently creating a post processing python script for Cura, of which the goal is to increment the E value of the gcode to compensate for the loss of materials, that occur when the extruder of the 3d printer is moving without printing. We need to compensate these loss because otherwise it create holes in the printing. But the size of the pieces are great (millions of gcodes lines), so to be able to modify the gcode in a correct amount of time I used the Multiprocessing of python. I had to work on windows so to use multiprocessing i need to have this line :
if __name__ == '__main__': # MultiProcessing
with Pool() as p:
resultat = p.map(traitement_gcode_lineaire,liste_traitement)
if len(resultat)!=0 :
for result in resultat :
fichier += result
When launch by myself (like in VS code) without Cura all is good. But the issue here is that it can't enter the loop because __name__ will never be equal to '__main__', but it always equal to :
'PostProcessingPlugin.PostProcessingPlugin.ModificationGcodeMultiProcessing'
where 'ModificationGcodeMultiProcessing' is the name of my postprocessing script and i never found any other script that was using multiprocessing so i was wandering if anybody has any clue for me.
"Do you get specific error messages" I don t have any error message but at the end 'Fichier' (which should contain the gcode that i modify) is empty.
I attach my code. But the issue is located in the function improve_extrusion (the other work perfectly)
ModificationGcodeMultiProcessing.zip