Skip to content

Commit 836dd33

Browse files
committed
Add StippleGen and TSP art tools
1 parent 0e8f232 commit 836dd33

File tree

15 files changed

+4595
-0
lines changed

15 files changed

+4595
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/**
2+
* EggBot Simple Write.
3+
*
4+
* Example code for talking to the EggBot from Processing.
5+
*/
6+
7+
8+
import processing.serial.*;
9+
10+
Serial myPort; // Create object from Serial class
11+
int val; // Data received from the serial port
12+
boolean PenDown;
13+
14+
15+
void liftPen()
16+
{
17+
myPort.write("SP,0\r");
18+
PenDown = false;
19+
}
20+
21+
void lowerPen()
22+
{
23+
myPort.write("SP,1\r");
24+
PenDown = true;
25+
}
26+
27+
28+
29+
30+
void Up()
31+
{
32+
myPort.write("SM,100,10,0\r");
33+
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>"
34+
}
35+
36+
void Down()
37+
{
38+
myPort.write("SM,100,-10,0\r");
39+
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>"
40+
}
41+
42+
43+
void Left()
44+
{
45+
myPort.write("SM,100,0,10\r");
46+
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>"
47+
}
48+
49+
void Right()
50+
{
51+
myPort.write("SM,100,0,-10\r");
52+
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>"
53+
}
54+
55+
56+
void setup()
57+
{
58+
size(800, 250);
59+
// I know that the first port in the serial list on my mac
60+
// is always my FTDI adaptor, so I open Serial.list()[0].
61+
// On Windows machines, this generally opens COM1.
62+
// Open whatever port is the one you're using.
63+
String portName = Serial.list()[1];
64+
myPort = new Serial(this, portName, 38400);
65+
66+
liftPen();
67+
background(255);
68+
}
69+
70+
//String str1 = "SP,1\r";
71+
72+
73+
void draw() {
74+
75+
// myPort.write("SM,25,0,50\r");
76+
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>"
77+
78+
// delay(500);
79+
// myPort.write("SM,25,0,0\r");
80+
81+
82+
}
83+
84+
85+
86+
void keyPressed()
87+
{
88+
// if the key is between 'A'(65) and 'z'(122)
89+
if( key == ' ')
90+
{
91+
92+
if (PenDown)
93+
liftPen();
94+
else
95+
lowerPen();
96+
}
97+
98+
if( key == 'u')
99+
{
100+
Up();
101+
}
102+
103+
if( key == 'd')
104+
{
105+
Down();
106+
}
107+
108+
109+
if( key == 'l')
110+
{
111+
Left();
112+
}
113+
114+
if( key == 'r')
115+
{
116+
Right();
117+
}
118+
119+
}
120+

other/StippleGen2/README.txt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
StippleGen_2
3+
4+
SVG Stipple Generator, v. 2.02
5+
Copyright (C) 2012 by Windell H. Oskay, www.evilmadscientist.com
6+
7+
Full Documentation: http://wiki.evilmadscience.com/StippleGen
8+
Blog post about the release: http://www.evilmadscientist.com/go/stipple2
9+
10+
11+
An implementation of Weighted Voronoi Stippling:
12+
http://mrl.nyu.edu/~ajsecord/stipples.html
13+
14+
15+
*******************************************************************************
16+
17+
Change Log:
18+
19+
v 2.02
20+
* Force files to end in .svg
21+
* Fix bug that gave wrong size to stipple files saved white stipples on black background
22+
23+
v 2.01:
24+
* Improved handling of Save process, to prevent accidental "not saving" by users.
25+
26+
v 2.0:
27+
* Add tone reversal option (white on black / black on white)
28+
* Reduce vertical extent of GUI, to reduce likelihood of cropping on small screens
29+
* Speling corections
30+
* Fixed a bug that caused unintended cropping of long, wide images
31+
* Reorganized GUI controls
32+
* Fail less disgracefully when a bad image type is selected.
33+
34+
*******************************************************************************
35+
36+
Program is based on the Toxic Libs Library ( http://toxiclibs.org/ )
37+
& example code:
38+
http://forum.processing.org/topic/toxiclib-voronoi-example-sketch
39+
40+
41+
Additional inspiration:
42+
Stipple Cam from Jim Bumgardner
43+
http://joyofprocessing.com/blog/2011/11/stipple-cam/
44+
45+
and
46+
47+
MeshLibDemo.pde - Demo of Lee Byron's Mesh library, by
48+
Marius Watz - http://workshop.evolutionzone.com/
49+
50+
51+
Requires ControlP5 library and Toxic Libs library:
52+
http://www.sojamo.de/libraries/controlP5/
53+
http://hg.postspectacular.com/toxiclibs/downloads
54+
55+
56+
57+
* This is free software; you can redistribute it and/or
58+
* modify it under the terms of the GNU Lesser General Public
59+
* License as published by the Free Software Foundation; either
60+
* version 2.1 of the License, or (at your option) any later version.
61+
*
62+
* http://creativecommons.org/licenses/LGPL/2.1/
63+
*
64+
* This library is distributed in the hope that it will be useful,
65+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
66+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
67+
* Lesser General Public License for more details.
68+
*
69+
* You should have received a copy of the GNU Lesser General Public
70+
* License along with this library; if not, write to the Free Software
71+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

0 commit comments

Comments
 (0)