Difference between revisions of "Generating TSP art from a stippled image"

From Evil Mad Scientist Wiki
Jump to: navigation, search
Line 1: Line 1:
== Introduction ==
 
 
 
http://mtbaldy.us/~dnewman/tspart/zebras.png
 
http://mtbaldy.us/~dnewman/tspart/zebras.png
  

Revision as of 19:55, 27 September 2010

zebras.png

Preliminaries

At this point, you should have a .pbm or .pts file containing the stippling information for the image you are working with. Without this information, you cannot proceed. See

Producing a stippled image with Gimp

for further details.

Also, you must already have installed a copy of Concorde TSP's linkern executable. For directions, please see

Obtaining a TSP solver

Finally, you need to obtain the latest versions of the following three files,

  • tspart.py
  • tspbitcity.py
  • tspsolution.py

These three files are hosted at the Eggbot code site,

http://code.google.com/p/eggbotcode/downloads/list

Download the lastest version of the tsp_art_tools zip file, tsp_art_tools_x_y.zip. After you unzip that file, you will see those three files within it. Copy those files to a convenient work directory.

Getting to work

zebras-svg.png

Notes for Window users

The script tspart.py is a Python script. Python is a programming language that is not normally part of Windows. However, having installed Inkscape, you now have a copy of Python. (If you have not yet installed Inkscape, then please refer to the instructions for installing Eggbot software for assistance.) To run tspart.py you will need to open a command window. If you are unfamiliar with how to do this, please see the Windows section of

Obtaining a TSP solver

for directions on how to do so on Windows XP.

Once you have an open command window, navigate to the directory containing the Inkscape executable, inkscape.exe. This will usually be C:\Program Files\Inkscape.

C:\Documents and Settings\Judy User>cd C:\Program Files\inkscape
C:\Program Files\inkscape>

Note that if you have installed Inkscape on a drive other than C:, you first need to move to that drive letter. For example, if Inkscape is installed on drive E:, use the commands

C:\Documents and Settings\Judy User>E:
E:\>cd E:\Program Files\inkscape
E:\Program Files\inkscape>


Once in that directory, the Python program should be in the python subdirectory. However, you must run that program from the Inkscape directory. To run tspart.py, issue the command

C:\Program Files\inkscape>python\python C:\tspart.py C:\image.pbm

In the above command, it is assumed that tspart.py, tspbitcity.py, tspsolution.py, and image.pbm are all in the top-level directory of the C: drive. Be sure to give the correct path to those files.