Carving foam with the Roland Modela MDX-3

I took a few moments to play with the Modela MDX-3 tabletop milling machine that has been sitting around HackPittsburgh for the last year. It turns out that it works as a character printer device, and all you need to do to get it to run is cat a specially formatted CAD file to the printer device. Using a sample file found on a forum, I was able to put together a simple python script to generate 2.5d jobs for engraving styrofoam. Like Master Li, the script has a slight flaw in it’s character, however it is only intended for helping to reverse engineer the file format. Ideally, one would want a workflow where you could print directly from a 2d vector drawing program or 3d modeling program.

The machine can probably be made to cut heavier stuff, we just need to find some different tools for it, and work out how to mount the material so that it is flatter. Source code and example files to cut out HACKPGH after the break.

#!/usr/bin/python
 
# Script to generate a cheap modela drawing file
 
# set the z-depths for moving and drilling
zHigh = 100;
zLow = -30;
 
infile = open("input.job","r");
outfile = open("output.rol","w");
 
lastX = 0;
lastY = 0;
lastZ = zHigh;
 
# Print out the magical header
outfile.write("^DF\n")
outfile.write("! 1\n")
outfile.write("V 64;F 64\n")
outfile.write("Z " + str(lastX) + " " + str(lastY) + " " + str(lastZ) + "\n")
outfile.write("V 64;F 64\n")
outfile.write("V 30;F 30\n")
# loop through the file, spitting out code for each line
for line in infile:
    line = line.rstrip()
 
    if (line == "U"):
        lastZ = zHigh
    elif (line == "D"):
        lastZ = zLow
    else:
        if (len(line.split(",")) != 2):
            continue;
 
        lastX,lastY = line.split(",")
 
    outfile.write("Z " + str(lastX) + " " + str(lastY) + " " + str(lastZ) + "\n")
 
outfile.write("V 0;F 0\n")

Here is the input job file that describes the logo:

1000,1000
D
1000,1600
1000,1300
1300,1300
1300,1600
1300,1000
U
1500,1000
D
1500,1600
1800,1600
1800,1000
1800,1300
1500,1300
U
2300,1600
D
2000,1600
2000,1000
2300,1000
U
2500,1000
D
2500,1600
2500,1300
2800,1600
2500,1300
2800,1000
U
3000,1000
D
3000,1600
3300,1600
3300,1300
3000,1300
U
3800,1600
D
3500,1600
3500,1000
3800,1000
3800,1300
3700,1300
U
4000,1000
D
4000,1600
4000,1300
4300,1300
4300,1600
4300,1000
U
800,800
D
800,1800
4500,1800
4500,800
800,800
U

And finally, here is the .ROL file that the script generates, which can be fed directly into the mill:

^DF
! 1
V 64;F 64
Z 0 0 100
V 64;F 64
V 30;F 30
Z 1000 1000 100
Z 1000 1000 -30
Z 1000 1600 -30
Z 1000 1300 -30
Z 1300 1300 -30
Z 1300 1600 -30
Z 1300 1000 -30
Z 1300 1000 100
Z 1500 1000 100
Z 1500 1000 -30
Z 1500 1600 -30
Z 1800 1600 -30
Z 1800 1000 -30
Z 1800 1300 -30
Z 1500 1300 -30
Z 1500 1300 100
Z 2300 1600 100
Z 2300 1600 -30
Z 2000 1600 -30
Z 2000 1000 -30
Z 2300 1000 -30
Z 2300 1000 100
Z 2500 1000 100
Z 2500 1000 -30
Z 2500 1600 -30
Z 2500 1300 -30
Z 2800 1600 -30
Z 2500 1300 -30
Z 2800 1000 -30
Z 2800 1000 100
Z 3000 1000 100
Z 3000 1000 -30
Z 3000 1600 -30
Z 3300 1600 -30
Z 3300 1300 -30
Z 3000 1300 -30
Z 3000 1300 100
Z 3800 1600 100
Z 3800 1600 -30
Z 3500 1600 -30
Z 3500 1000 -30
Z 3800 1000 -30
Z 3800 1300 -30
Z 3700 1300 -30
Z 3700 1300 100
Z 4000 1000 100
Z 4000 1000 -30
Z 4000 1600 -30
Z 4000 1300 -30
Z 4300 1300 -30
Z 4300 1600 -30
Z 4300 1000 -30
Z 4300 1000 100
Z 800 800 100
Z 800 800 -30
Z 800 1800 -30
Z 4500 1800 -30
Z 4500 800 -30
Z 800 800 -30
Z 800 800 100
V 0;F 0
This entry was posted in tech. Bookmark the permalink.

4 Responses to Carving foam with the Roland Modela MDX-3

  1. Robin J. says:

    Wow a Styrofoam engraver!! Just think of all the havoc you could create with your packing peanuts. You could send someone a package with monogrammed peanuts. Or you could write a word per packing peanut so they could sort them into whatever message they wanted to hear from you. Hmm….now I am dying to do that to someone. :D

  2. mahto says:

    @Robin J.
    Ah… I had not considered this! The most time-consuming packaging ever!

    Now I want try routing other things, like chocolate or something. Wonder if its possible to do without melting it too much?

  3. Matthew B says:

    @mahto
    Perhaps freezing the chocolate first would help, or maybe we should add a liquid nitrogen delivery system, to cool the cutting head…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>