{"id":65021,"key":"3D_Metal_Printing_Slicer_Plugin","title":"3D Metal Printing Slicer Plugin","latest":{"id":1209720,"timestamp":"2025-11-28T03:05:10Z"},"content_model":"wikitext","license":{"url":"https://www.appropedia.org/Appropedia:Copyrights","title":"CC-BY-SA-4.0"},"source":"{{MOST}}\n\n''' 3D Metal Printing Slicer Plugin '''\n\nThis is a plugin for the slicing software Cura which will create G-Code specific for the MOST delta [[Open-source metal 3-D printer]].<br>\n<font color=\"red\"><big>NOTICE:</big> This plugin is only tested to work with Cura v14.x. It is not guaranteed to work on any version of Cura greater than 14.x.</font>\n\n=== Installation Instructions ===\n\n* Download the Welder.py file from [https://github.com/mtu-most/MOST-delta-stage.git here].\n** If you cannot obtain the code from GitHub, copy the code from below and save it as Welder.py\n\n #!/usr/bin/python\n #Name: Welder\n #Info: Mangle GCode to work on welder (2014-02-10)\n #Depend: GCode\n #Type: postprocess\n #Param: speed(float:10) target extruder speed (mm/s)\n #Param: mindist(float:1) minimum travel distance to switch off welder (mm)\n #Param: ON(str:G4 P0;M42 P0 S3) Commands to insert after travel\n #Param: OFF(str:G4 P0;M42 P0 S0) Commands to insert before travel\n \n import sys\n \n __author__ = 'Bas Wijnen <wijnen@debian.org>'\n __date__ = '2014-02-10'\n __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'\n \n try:\n \tinfilename = filename\n \toutfilename = filename\n \tON = ON.strip ().replace (';', '\\n') + '\\n'\n \tOFF = OFF.strip ().replace (';', '\\n') + '\\n'\n except NameError:\n \t#assert len (sys.argv) in (3, 5)\n \tinfilename = sys.stdin\n \toutfilename = sys.stdout\n \tspeed = float (sys.argv[1]) if len (sys.argv) > 3 else .8\n \tmindist = float (sys.argv[2]) if len (sys.argv) > 4 else 1.\n \tON = 'G4 P0\\nM42 P0 S3\\n'\n \tOFF = 'G4 P0\\nM42 P0 S0\\n'\n extruding = False\n pos = [0., 0., 0., 0.]\n erel = None\n rel = False\n edata = [0.,0.]\n \n def parse (line):\n \tedata[0] = pos[3]\n \tglobal rel, erel, extruding\n \tif ';' in line:\n \t\tl = line[:line.find (';')]\n \telif '//' in line:\n \t\tl = line[:line.find ('//')]\n \telse:\n \t\tl = line\n \tcomponents = l.split ()\n \tif len (components) == 0:\n \t\treturn line\n \tif components[0] in ('M109', 'M104', 'M190', 'M140'):\n \t\treturn ''\n \tif components[0] == 'G90':\n \t\trel = False\n \tif components[0] == 'G91':\n \t\trel = True\n \tif components[0] == 'M82':\n \t\terel = False\n \tif components[0] == 'M83':\n \t\terel = True\n \tif components[0] == 'G92':\n \t\tfor w in components:\n \t\t\tif w[0] in 'XYZ':\n \t\t\t\twh = ord (w[0]) - ord ('X')\n \t\t\t\tpos[wh] = float (w[1:])\n \t\t\telif w[0] == 'E':\n \t\t\t\tpos[3] = float (w[1:])\n \tif components[0] not in ('G0', 'G1'):\n \t\treturn line\n \tparts = {}\n \tfor p in components[1:]:\n \t\tif p[0] in parts or p[0] not in 'XYZEF':\n \t\t\tprint 'warning: %s' % line\n \t\t\treturn line\n \t\tparts[p[0]] = float (p[1:])\n \tx = []\n \tfor i, c in enumerate ('XYZE'):\n \t\tif c in parts:\n \t\t\tx.append (parts[c] if (rel if i < 3 or erel is None else erel) else parts[c] - pos[i])\n \t\t\tpos[i] += x[-1]\n \t\telse:\n \t\t\tx.append (0.)\n \tdist = sum ([t ** 2 for t in x[:3]]) ** .5\n \tif 'E' not in parts or x[3] <= 0:\n \t\tif extruding and dist > mindist:\n \t\t\textruding = False\n \t\t\treturn OFF + line\n \t\treturn line\n \tdel parts['E']\n \tt = x[3] / speed\n \tparts['F'] = dist / t * 60.\n \tret = 'G1 ' + ' '.join (['%s%f' % (c, parts[c]) for c in parts])\n \tif not extruding:\n \t\textruding = True\n \t\treturn ON + ret\n \tedata[1] = pos[3]\n \treturn ret\n \n \n try:\n \tif isinstance (infilename, str):\n \t\twith open (infilename, \"r\") as f:\n \t\t\tlines = f.readlines ()\n \telse:\n \t\tlines = infilename.readlines ()\n \n \tif isinstance (outfilename, str):\n \t\twith open (outfilename, \"w\") as f:\n \t\t\tfor line in lines:\n \t\t\t\tf.write (parse (line.strip ()) + '\\n')\n \telse:\n \t\tfor line in lines:\n \t\t\toutfilename.write (parse (line.strip ()) + '\\n')\n except:\n \tprint ('something was wrong:', sys.exc_value)\n\n* Open Cura and make sure the switch to full settings is selected under the expert menu\n* Click on the plugin tab and navigate to the bottom of the screen where there is an \"Open plugin location\" button\n* Click on the button and it will open up a file browser window, drag and drop the Welder.py into the window, and close the window.\n* Restart Cura and the Welder plugin will be in the plugins box.\n\n=== Use ===\n\n[[File:cura welderplug.png|thumb|Figure 1: Overview of Cura with Welder.py plugin active]]\n\n* To use the Welder plugin double click on it and a Welder window will appear in the \"Enabled Plugins\" section of the tab.\n* There are a few different options the plugin as seen in Figure 1.\n** The target extruder speed is the target speed for the bed to move while the welder is turned on.\n** The minimum travel distance to switch off welder is the minimum distance the welder has to travel before the plugin will insert a command to turn it off.\n*** Set this value at around ten unless you have a very special print. It is not good to constantly switch the welder on and off because doing so will eventually overheat the welder\n** The commands to insert after/before travel inserts the entered G-code after and before a large block of movement set by the field above.\n*** For example G4 P5000;M42 P1 S0 for the MOST delta [[Open-source metal 3-D printer]] will pause the welder for 5s and then turn the welder on.\n* Once you have entered your values in the plugin, slicing is the same as normally using Cura.\n* After you have sliced the G-code, go back and double check the code for any conflicts.\n\n== See also ==\n\n* [[Open-source metal 3-D printer]]\n* [[MOST open-source metal 3-D printer v2]]\n* [[Low-cost Open-Source Voltage and Current Monitor for Gas Metal Arc Weld 3-D Printing]]\n* [[Integrated Voltage—Current Monitoring and Control of Gas Metal Arc Weld Magnetic Ball-Jointed Open Source 3-D Printer]]\n* [[Substrate Release Mechanisms for Gas Metal Arc Weld 3D Aluminum Metal Printing]] - how to get your print off the substrate with a hammer\n* [[In Situ Formation of Substrate Release Mechanisms for Gas Metal Arc Weld Metal 3-D Printing]]\n* [[Aluminum substrate cleaning for 3-D printing:MOST]]\n\n{{Page data\n| license = CC-BY-SA-3.0\n| description = This plugin helps the MOST delta printer slice 3D metal designs. Appropedia shares install tips and workflow improvements.\n}}\n\n[[Category:MOST methods]]\n[[Category:Metal 3D printing]]"}