Editing Color TSP art
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 43: | Line 43: | ||
== Generate TSP art == | == Generate TSP art == | ||
− | When generating the TSP art, we will use the <tt>-- | + | When generating the TSP art, we will use the <tt>--line-color</tt> option to tspart.py to control the color of each drawn TSP solution. Also, so as to make output SVG files which can be combined into a single SVG file, we will also use the <tt>--pre</tt>, <tt>--mid</tt>, and <tt>--post</tt> options. Those options allow us to say that one output file is to include the preamble of a SVG file, another output fille is to have the postamble, and that the other files should have neither. Each individual file will not be a complete SVG file. However, when all the files are appended one after the other, they will create a valid SVG file. |
Before proceeding, we should consider the order in which we want to draw the colors. On our Eggbot, we probably want to draw yellow first, followed by cyan, then magenta, and then black. This way we don't soil our yellow pen tip by drawing over darker ink colors. Similar considerations hold for cyan and magenta. However, when drawing on our screen, we want the reverse ordering so that yellow doesn't get completely lost under the other colors. On our screen, the colors won't blend: instead yellow pixels will simply be replaced by pixels of other colors which happen to draw over them. | Before proceeding, we should consider the order in which we want to draw the colors. On our Eggbot, we probably want to draw yellow first, followed by cyan, then magenta, and then black. This way we don't soil our yellow pen tip by drawing over darker ink colors. Similar considerations hold for cyan and magenta. However, when drawing on our screen, we want the reverse ordering so that yellow doesn't get completely lost under the other colors. On our screen, the colors won't blend: instead yellow pixels will simply be replaced by pixels of other colors which happen to draw over them. | ||
Line 50: | Line 50: | ||
<pre> | <pre> | ||
− | % python tspart.py -- | + | % python tspart.py --line-color=yellow --pre --runs=1 --layer="1 - yellow" yellow.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=cyan --mid --runs=1 --layer="2 - cyan" cyan.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=magenta --mid --runs=1 --layer="3 - magenta" magenta.pbm |
% python tspart.py --post --runs=1 --layer="4 - black" black.pbm | % python tspart.py --post --runs=1 --layer="4 - black" black.pbm | ||
</pre> | </pre> | ||
Line 74: | Line 74: | ||
<pre> | <pre> | ||
% python tspart.py --pre --runs=1 black.pbm | % python tspart.py --pre --runs=1 black.pbm | ||
− | % python tspart.py -- | + | % python tspart.py --line-color=magenta --mid --runs=1 magenta.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=cyan --mid --runs=1 cyan.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=yellow --post --runs=1 yellow.pbm |
% cat black.svg magenta.svg cyan.svg yellow.svg > picture.svg | % cat black.svg magenta.svg cyan.svg yellow.svg > picture.svg | ||
</pre> | </pre> |