jromero / tsp_art_tools Goto Github PK
View Code? Open in Web Editor NEWA hosted source repo of tsp_art_tools provided from https://code.google.com/p/eggbotcode
A hosted source repo of tsp_art_tools provided from https://code.google.com/p/eggbotcode
5 October 2010 This directory contains some tools for generating TSP art for the Eggbot. These tools have only been tested quite a bit under OS X 10.6. These tools have had very limited testing on Windows XP SP3. 25 Sep 2010 v0.1 Initial version 27 Sep 2010 v0.1 Added --count and --runs options 28 Sep 2010 v0.3 Added support for (x,y) and (x,y,radius) files 1 Oct 2010 v0.4 Decided to close the TSP tour after all; added --max-segments, and --fill options 3 Oct 2010 v0.5 Added --line-color, --pre, --mid, & --post options for color TSP art 4 Oct 2010 v0.6 Added --layer for specifying layer names 5 Oct 2010 v0.7 Fix help documentation, change --line-color to --stroke 7 Oct 2010 v0.8 Added cmyk.jsx for Photoshop 10 Oct 2010 v0.8.1 Added metadata; XML comment referencing Eggbot 1 Dec 2011 V0.8.2 Fixed an incorrect error diagnostic which when output prematurely ended processing; switched to a different Python library for running linkern in a "subprocess" so as to support current versions of Python on Windows 7 (thanks to Peter Vancorenland for diagnosing the issue, researching a fix, and testing it!) 7 Mar 2012 V0.8.3 Build the tour file in the user's temporary file directory. This avoids issues with file permissions on some systems where it's most convenient to run tspart.py from within a specific directory that the user may not have write access to. Note that other temporary files were already being written (and then removed) from the temp. directory. For purposes of debugging, the tour file was being written to the current working directory. That is no longer done. build-concorde-osx.sh Shell script to obtain with Curl the QSopt LP Solver library and the Concorde TSP library and places them in /usr/local/src/concorde. The script then builds either a 32bit or 64bit version of the Concorde TSP library and places symlinks in /usr/local/bin/ for the concorde and linkern executables. (Note: QSopt is not needed for linkern.) This script will need modification for Linux. While binary executables are available for concorde and linkern for Windows, they require a minimal cygwin install. See http://www.tsp.gatech.edu/concorde/downloads/downloads.htm cmyk.jsx Photoshop script for producing CMYK "separations" for Color TSP art. Tested on Mac OS X 10.6.4 with Photoshop CS5. STIPPLING.txt Fifty words or less explaining how to do quick stippling in gimp. A useful means of getting a bitmap to feed to tspart.py. tspart.py Python script to accept as input a black and white bitmap file in PBM format and produce as output a SVG file (TSP art) arrived at by using the fast, heuristic TSP solver linkern. In addition to PBM files, a simple format allowing (x, y) or (x, y, radius) coordinates is also supported. (E.g., the format output by some stippling software.) See the comments in tspbitcity.py for further details. tspbitcity.py Python class used by tspart.py. This is the class which reads in a PBM file and can generate a TSPLIB format file for concorde and linkern. Also, using a TSP tour, it can generate an SVG file. If run as a standalone Python script, tspbitcity.py will generate a TSPLIB file from a PBM file. tspsolution.py Python class used by tspart.py. This class reads a solution file from either concorde or linkern and determines the "tour". This "tour" is then used by tspart.py to generate the output SVG file. -- finit --
I am getting a stack trace error when using tspart.pt on a file in a different directory.
e.g. $python tsp_art_tools/trunk/tspart.py Pictures/Gocupi/cascadebmpindex.pbm
Expected this to work OK with relative paths. Suggest updating code to set "infile" and "outfile" as absolute paths before working with them.
Script runs fine when python is invoked from the same dir as the input file.
Here is the full Trace.
Traceback (most recent call last):
File "tsp_art_tools/trunk/tspart.py", line 243, in
tsp_fd, tspfile = tempfile.mkstemp( suffix='.tsp', prefix=tmp_prefix, text=True )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 304, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 239, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 2] No such file or directory: '/var/folders/dm/ll6_b6xx2b56sygrlzdw2vb40000gn/T/Pictures/Gocupi/cascadebmpindex.wFpjtz.tsp'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.