Archive for the ‘Unicorn’ Category

Tips for Making TSP Art

Victory!  Victory for the Daleks!

Victory! Victory for the Daleks!

Yesterday I posted a tutorial on how to make TSP (traveling salesman problem) single line drawing art.  If you’re looking to create your own TSP single line drawing artwork from an image, there are few things you can do to ensure a better result:

  • Before the “Make a Stippled Image” step, try adjusting the contrast.  Increasing the contrast will make the lighter areas have less stippled points in the following step.  Decreasing the contrast will make the lighter areas have more stippled points.  This is really just a matter of taste, so have fun experimenting with the results.
  • Before the “Make a Stippled Image” step, try decreasing the file size.  Decreasing the file size will also decrease the number of stippled points.  If you have too many stippled points, the resulting SVG image file look like a jumbled mess of squiggles.  The image above was created by reducing the original image size by 50%.
  • Make your batch file “drag and drop.”  By editing the Batch file in the “Create a Batch file to automate the Stippled Image to a TSP Line Drawing conversion” step, you can actually make the Batch file conversion as easy as dragging and dropping your PBM file onto the Batch file.  In order to make your Batch file “drag and drop” replace the location of the PBM file with “%1″.  This will tell the batch file to convert whatever PBM file was dropped onto it.  So, your Batch file should look like this:
    • c:\python\python C:\Users\MakerBlock\Desktop\TSP\scripts\tspart.py %1
  • Adjust the SVG in the free open source SVG image editing software Inkscape1  You can trim any unnecessary space around your image easily by:
    • File->Document Properties
    • Click “Resize page to content
    • Adjust the borders to suit and click “Resize page to drawing or selection

Good luck!

This thing brought to you by Thingiverse.com

  1. I prefer the PortableApps.com version []
Tagged with , , , , , , , , , Leave a comment
 

Single Line Art / Traveling Salesman Problem Tutorial

MakerBot Replicator TSP Single Line Drawing

MakerBot Replicator TSP Single Line Drawing

The “Traveling Salesman Problem” (“TSP”) is a problem studied in mathematics where one tries to figure out the shortest path through a number of points.  Solving for the absolute shortest route can take a lot of processing power and time, but getting a pretty good approximation can be very quick.  The Eggbot, MakerBot Unicorn, and drawing robots are particularly well suited to these kinds of drawings.

Recently I tried to create some of my own single line / TSP art based using the awesome Evil Mad Science TSP guide.  In doing so I think I may have figured out a way simplify the process slightly for Windows users. 1  The EMS guide has the user install Cygwin in order to provide certain elements of Unix for running the Concorde or Linkern TSP solvers.  However, I accidentally discovered that once you have the “cygwin1.dll” out of the Cygwin installation, all you need to do is create a batch file for automating the TSP conversion.  So, start to finish, here’s how I do it:

Programs / Scripts

  1. Download and install the free open source Python programming language
  2. Download and install the free open source GIMP image manipulation software2
  3. Download the Evil Mad Scientist Eggbot scripts for creating TSP vector art.  You’ll want the file named, “tsp_art_tools_0_8_3.zip”
  4. Download the Linkern TSP solver from Georgia Tech’s website
  5. Download the “cygwin1.dll” file for running the Linkern TSP solver on a Windows platform

Install Scripts

  1. Put the “cygwin1.dll”, “linkern.exe”, “tspart.py” , “tspbitcity.py”, “tspsolution.py” into a folder location of your choice

Make a Grayscale Image

  1. Open your image in GIMP
  2. Turn the color information monochrome “Image -> Mode -> Grayscale
  3. Open the color levels “Colors -> Levels
  4. Wash out the image by adjusting “All Channels” in the pop-up window to some value to 2003

Make a Stippled Image

  1. Turn the washed out grayscale image into a stippled image “Create Image->Mode->Indexed
  2. Select these options in the pop-up window
    • Use black and white (1-bit) palette): Checked
    • Remove unused colors from colormap: Checked
    • Color dithering: Floyd-Steinberg (normal)
  3. Click “Convert
  4. Save the file in the “Portable Bit Map” format “File->Save As” and saving the file with the extension “.pbm
    • If given the option, choose to save the PBM file in the “Raw” format

Create a Batch file to automate the Stippled Image to a TSP Line Drawing conversion

  1. Open “tspart.py” with your favorite text editor4 and change line 76
    • From:      LINKERN = ‘C:\linkern.exe’
    • To:    LINKERN = ‘C:\FILELOCATION\linkern.exe’
    • Save “tspart.py”
  2. The command for converting the PBM file takes three parts, the location of Python, the location of “tspart.py” and the location of your PBM file.  Here are where my files are located:
    • My Python directory is located at “c:\python\python”
    • My scripts are located in a subdirectory on my desktop “c:\python\python C:\Users\MakerBlock\Desktop\TSP\scripts\tspart.py”
    • My PBM file is also located on my desktop “C:\Users\MakerBlock\Desktop\TSP\images\drawing.pbm”
  3. Open a text editor and copy these three locations into one line as follows:
    • c:\python\python C:\Users\MakerBlock\Desktop\TSP\scripts\tspart.py C:\Users\MakerBlock\Desktop\TSP\images\drawing.pbm
  4. Save the text as a batch file named “convert2tsp.bat”

Use the Batch file to convert the Stippled Image to a TSP Line Drawing

  1. Double-clicking the batch file will convert “drawing.pbm” into “drawing.svg”
  2. To convert your next file, you can either name it to “drawing.pbm” or edit the Batch file to reflect a different PBM file name.

If you haven’t tried to create some single-line-artwork yet, give it a shot today!  It’s a lot easier than it looks and the results are really satisfying!

Once you’ve gone through the above process once, it goes super quickly the second time.  You basically make your image grayscale, wash it out, save as a stipple file format, and then run the batch file.  The entire process takes about two minutes once you get the hang of it – with a full minute and a half or so just devoted to letting the TSP program do its thing.

This thing brought to you by Thingiverse.com
  1. I know.  I’m trying to give it up too… []
  2. I like the PortableApps.com version []
  3. Values between 180 and 245 should work well []
  4. I like the PortableApps.com version of Notepad++ []
Tagged with , , , , , , , 12 comments
 

Robot Hospital! Episode Ten!

YouTube Preview Image

In this episode Keith takes us on an awesome tour of RobotFest 2011 at the National Electronics Museum, Ethan pushes the extreme limits of acrylic T-Slot construction, and Matt traps and traces a massive squirrel- Check it out!

Tagged with , , , , , , , , Leave a comment
 

Inkscape for Unicorn Users

Inkscape for Unicorn Users

Inkscape for Unicorn Users

I’m not a veteran Inkscape user by any means. 1  I’ve learned just enough about Inkscape to be able to make use of Schmarty’s excellent Inkscape->Gcode plugin and print fun things out on my Unicorn.  In case you’re new to Inkscape as well, here are a few things you’d need to know to make the most of it with your Unicorn.

  1. How to convert a JPG or PNG into an SVG using Inkscape
    1. File -> Import -> [your file]
    2. Select all
    3. Path -> Trace Bitmap
    4. Click “Grays”
    5. Choose a number under “Scans”
      • I have been using 6, but use whatever gives you the desired effect.  This will essentially “posterize” your object into at most 6 shades of gray.  This is the setting with which you’re really going to want to experiment.
      • The Gcode output by Schmarty’s excellent Inkscape->Gcode plugin will instruct the Unicorn to draw each layer.  The more colors, the more layers.  This could be a good thing if you’re switching out pens.
    6. Select all
    7. Path -> Object to Path
    8. File -> Save As -> [your desired file name or type]
  2. How to change units for the ruler in Inkscape
    1. File -> Document Properties -> Page -> Default units [your favorite unit]
  3. How to change your default template in Inkscape
    1. Configure a blank SVG file exactly as you want your new default template to look
    2. Save your blank SVG file as “default.svg” somewhere convenient
    3. Navigate to your “Templates” folder for Inkscape
      • This will usually be in a subdirectory of your Inkscape installation, but may vary depending upon your operating system.
      • I’m using the PortableApps version of Inkscape2 , so my Templates directory on Windows is “InkscapePortable\App\Inkscape\share\templates”
    4. Rename the current “default.svg” to something else
      • You may want to come back to it some day.  If that’s a possibility, I’d recommend “default_original.svg” or some variation thereof.
    5. Cut and paste the “default.svg” you created above to the “Templates” folder
  1. Inkscape is a free open source vector drawing program. []
  2. I have this thing about commitment. []
Tagged with , , , , Leave a comment
 

What do you get when you cross a Unicorn, a belt, and a roll of tape?

Paper rolls

Paper rolls

I was chatting with a friend about the new “MakerBot party mode,” when I wondered if anyone had ever tried using a Unicorn in conjunction with an Automated Build Platform and a tape roll from a calculator. 12

I think it would be really cool to have something like this.  It could be used to run a Unicorn continuously, churning out little stick figures dancing on a roll of paper.  Or, perhaps, a novel written in reverse. 34 5

I suspect in order to do this successfully you would need:

  1. To run the Unicorn relatively slowly.  This way the paper wouldn’t be shoved out of shape too much as it rolled in
  2. Only draw pictures within a relatively small area.  Again, so that the paper wouldn’t be shoved out of shape
  3. The tape roll would have to run from somewhere outside the rear of the ‘bot.  The full roll would add a lot of mass to the XY platform.  I suppose this wouldn’t be a problem if you ran the Unicorn slowly enough.
  4. A clamp might be needed to hold the tape roll to the motorized ABP axle.  This would help keep the paper in place as you print and also grip the paper when it needs to roll forward.  I suppose an alternative is to use a variation on the ABP that would
  5. To re-write the Unicorn code so that it would move the paper forward as it printed.  It could advance the paper as little as one line at a time or roll through to a totally new section.

Did I miss anything?  What else might you need?

  1. These still exist, right? []
  2. Photo courtesy of Steve Snodgrass []
  3. I would call it: “It Did Butler The”  A time traveling butler tries to clean up the past…  but ends up causing the disasters he seeks to prevent. []
  4. I have to say…  that doesn’t sound nearly as awful as I had intended it to be… []
  5. If you’re interested in the movie rights, e-mail me. []
Tagged with , , , , , 4 comments
 

ToMcat the Pen Plotter by ScribbleJ

ToMcat the Pen Plotter by ScribbleJ

It is no secret that I am a fan of pen plotters. Well, I’m thoroughly enchanted by ScribbleJ’s work-in-progress 3D printed pen holder. It is one thing to name a machine after an animal — it is another to successfully integrate that animal motif into the functional design.

I can’t wait to print this pen holder and see how it compares to my MakerBot Unicorn Pen Plotter.

YouTube Preview Image
This thing brought to you by Thingiverse.com
Tagged with , , , , , , Leave a comment
 

Band Ghost Ghost to Feature MakerBot Unicorn Pen Plotting at SXSW Interactive

Tim Bartlett Grabbing Visuals for SXSW Dorkbot/Ignite 2011 at NYCR

MakerBot friend Tim Bartlett1 came over to Craft Night at NYC Resistor last week to shoot real time visuals for a little performance this coming Friday in Austin, Texas.

He is the real-time video artist for the band Ghost Ghost, who will be the house band for the Dorkbot/Ignite event in Austin Music Hall, opening night of a wee festival called SXSW Interactive….

Thanks to  Matt Mets for his late, late night assistance hacking on old pen plotters to get more visuals! And to NYCR for welcoming Tim in and sharing oscilloscopes and laser-cutters. And to Keith Ozar for helping us setup and experiment.

Check out this video post card that features some of the visuals he captured on MakerBots.

YouTube Preview Image
  1. Thanks for lending us your Canon 7D for so many MakerBot videos! []
Tagged with , , , , , , , , , Leave a comment
 

Wanted: SUPER Fast Traveling Salesman

 

TSP crossing

TSP crossing

The question behind the “Traveling Salesman Problem” is basically, what’s the most efficient path through a large number of points? 1  There are probably many important applications of this difficult mathematical problem, but the most interesting for me is line art.  If you’ve been following the progress of the MakerBot Unicorn or Egg-Bot projects, you’ve already seen some incredible examples of “TSP” line art.

This thing brought to you by Thingiverse.com

This thing brought to you by Thingiverse.com

This thing brought to you by Thingiverse.com

The current process for converting a picture to TSP line art is pretty involved.  From the excellent TSP line art tutorial over at Evil Mad Scientist labs, the process involves converting the image to greyscale, converting it into a stippled image, putting the points through a TSP solver such as the Concorde TSP solver package to create the TSP line art from the stippled image and end up with an SVG file.  At that point you could probably use Schmarty’s Inkscape GCode extension23

I would love to see this process become simplified.  I suspect the best method for doing so might lie in the creation of a GIMP4 plugin.  GIMP already has the mechanisms for many of the above steps.  A GIMP plugin could probably automate the “grayscale -> stippled image -> point puddle” process.56  Once that was done, the resulting “point puddle” would still need to be fed through the TSP solver.  However, I suspect this might be able to be done by having GIMP call the Concorde TSP solver.  This would take it from “point puddle -> TSP solver -> SVG file” which could then be turned into GCode using the above Inkscape extension.

Besides my belief that there just isn’t enough TSP line art in the world, there are a bunch of reasons I’d love to see this plugin pop into existence.   The top three reasons being the Unicorn, the Egg-Bot, the CNC Etch-a-Sketch.  :)   After that, I’d have to say – TSP line art renderings of photographs and old master works of art.  I would love to see a web cam hooked up to a Unicorn for instant TSP line art photobooth style sticky note generation!

  1. Photo courtesy of robotson []
  2. Basically, image -> gray image -> point puddle -> TSP solver -> printable SVG path []
  3. I say point puddle since it’s not a 3D point cloud.  Just a 2D … puddle of points. []
  4. My favorite open source image manipulation/editing software []
  5. See note above last for explanation of “point puddle.” []
  6. “Point puddle” you heard it here first! []
Tagged with , , , , , , , , , , , , 3 comments
 

Unicorns: Making it stick

Sketch to Plot

Sketch to Plot

One of my favorite things to turn into Unicorn pen plottings is sketches.  On Saturday I took photos of my own pen and ink sketches1 , imported them into Inkscape, and then converted them to GCode.  Sketching something once is fun.  Cranking out a stack of sticky notes with the same sketch is AWESOME.

Here’s my process for converting sketches:

  1. Fire up Inkscape.
  2. File -> Import. Import your photo, scan, or picture.
  3. Path -> Trace Bitmap. This is where you get to have some fun.  For black and white sketches, I like to use these settings:
    • Grays: checked
    • Scans: 2
    • Smooth: checked
    • Stack scans: checked
    • Remove background: checked
  4. Click to select and then delete the original picture
  5. File -> Save As.
    • File name: Choose a good file name.
    • Save as type: MakerBot Unicorn G-Code (*.gcode)

Let me know how it goes!

  1. With my crappy cell phone camera no less! []
Tagged with , , , 2 comments
 

An Epic Robot Hospital!

This weeks Robot Hospital! Episode Two is truly reaching for new heights of pre-production here at the BotCave! Those crazy live-stream days are fading into memory~ We have a great instructional segment from Ethan, who teaches you proper Stepper Driver Calibration, and later he covers the 3D Printing blogosphere in his weekly “Blog Rap.” Griffin and Marty demonstrate connecting the Unicorn to the Thing-O-Matic in fine style, and Matt details some great, and not so great, ideas for finishing techniques to use on your printed objects. We have a second interview with Marek from BeatBots, and the Keepon stops by and teaches robots everywhere how to hold space on the dance floor. Isaac drops in to discuss MakerBot Water Soluble PVA, and debuts version one of the Robot Hospital! intro! We’re going for it with this episode, it’s a new benchmark for what’s to come! Musical intro chops from “The Insider”

Tagged with , , , , , , , , , 5 comments