UltiMaker uses functional, analytical and tracking cookies. Tracking cookies enhance your experience on our website and may also collect your personal data outside of Ultimaker websites. If you agree with the use of tracking cookies, click “I agree, continue browsing”. You can withdraw your consent at any time. If you do not consent with the use of tracking cookies, click “Refuse”. You can find more information about cookies on our Privacy and Cookie Policy page.
Multithreading and Multi processing for python script in Cura
Posted
· Multithreading and Multi processing for python script in Cura
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 :
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 :
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.
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)
The full stable release of UltiMaker Cura 5.4 is here and it makes it easier than ever to remove brims and supports from your finished prints. UltiMaker S series users can also look forward to print profiles for our newest UltiMaker PET CF composite material!
Recommended Posts
VictorMic 0
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 :
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 :
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.
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
Link to post
Share on other sites