├── .gitignore
├── 2016_02
├── dbe_2016_02_26_v1.py
├── dbe_2016_02_27_v1.py
├── dbe_2016_02_27_v2.py
├── dbe_2016_02_28_v1.py
└── dbe_2016_02_29_v1.py
├── 2016_03
├── dbe_2016_03_01_v1.py
├── dbe_2016_03_02_v1.py
├── dbe_2016_03_02_v2.py
├── dbe_2016_03_03_v1.py
├── dbe_2016_03_03_v2.py
├── dbe_2016_03_04_v1.py
├── dbe_2016_03_05_v1.py
├── dbe_2016_03_06_v1.py
├── dbe_2016_03_07_v1.py
├── dbe_2016_03_08_v1.py
├── dbe_2016_03_09_v1.py
├── dbe_2016_03_10_v1.py
├── dbe_2016_03_10_v2.py
├── dbe_2016_03_11_v1.py
├── dbe_2016_03_12_v1.py
├── dbe_2016_03_13_v1.py
├── dbe_2016_03_14_v1.py
├── dbe_2016_03_14_v2.py
├── dbe_2016_03_15_v1.py
├── dbe_2016_03_16_v1.py
├── dbe_2016_03_17_v1.py
├── dbe_2016_03_18_v1.py
├── dbe_2016_03_19_v1.py
├── dbe_2016_03_20_v1.py
├── dbe_2016_03_21_v1.py
├── dbe_2016_03_22_v1.py
├── dbe_2016_03_23_v1.py
├── dbe_2016_03_24_v1.py
├── dbe_2016_03_26_v1.py
├── dbe_2016_03_27_v1.py
├── dbe_2016_03_28_v1.py
├── dbe_2016_03_29_v1.py
└── notes.py
├── 2016_09
└── dbe_2016_09_10.py
├── 2017-01
├── 2017-jan-05.py
├── 2017-jan-06.py
├── 2017-jan-07.py
└── 2017-jan-08.py
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
--------------------------------------------------------------------------------
/2016_02/dbe_2016_02_26_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 02/26/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | # pep-8 maximum-line-length #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | # setting up the canvas size and main variables
10 |
11 | import random
12 |
13 | gridpoints = [128, 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, 384]
14 | canvas = 512 # size of the gif in pixels
15 | margin = 128 # distance from edge of canvas
16 | num_frames = 16 # number of frames in the animation
17 | step = 0 # steps in looping animation
18 |
19 | # draw the canvas
20 | for frame in range(num_frames):
21 | newPage(canvas, canvas)
22 | frameDuration(1/2)
23 | fill(0.8)
24 | rect(0, 0, canvas, canvas)
25 |
26 | # draw the grid
27 | fill(None)
28 | stroke(0.5)
29 | strokeWidth(1)
30 | lineCap("round")
31 | lineJoin("round")
32 |
33 | # grid X-axis
34 | stepx = -16 # step in sequence on x axis
35 | incx = 16 # grid increment
36 | for x in range(17):
37 | save()
38 | stepx = stepx + incx
39 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
40 | restore()
41 |
42 | # grid Y-axis
43 | stepy = -16 # step in sequence on y axis
44 | incy = 16 # grid increment
45 | for y in range(17):
46 | save()
47 | stepy = stepy + incy
48 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
49 | restore()
50 |
51 | # guides
52 | # stroke(1, 0, 0, 0.4)
53 | # strokeWidth(0.5)
54 | # polygon((0, 128), (512, 128))
55 | # polygon((0, 128+256), (512, 128+256))
56 | # polygon((128, 0), (128, 512))
57 | # polygon((128+256, 0), (128+256, 512))
58 | # polygon((256, 0), (256, 512))
59 | # polygon((0, 256), (512, 256))
60 |
61 | # animation loop
62 | for frame in range(num_frames):
63 | save()
64 | a = (random.choice(gridpoints))
65 | b = (random.choice(gridpoints))
66 | c = (random.choice(gridpoints))
67 | fill(1, 1, 1)
68 | stroke(0.5)
69 | strokeWidth(1.5)
70 | oval(c-5, a-5, 10, 10)
71 | oval(b-5, c-5, 10, 10)
72 | oval(a-5, b-5, 10, 10)
73 | restore()
74 |
75 | saveImage("dbe_2016_02_26_v1.gif")
--------------------------------------------------------------------------------
/2016_02/dbe_2016_02_27_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 02/27/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | # pep-8 maximum-line-length #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | # setting up the canvas size and main variables
10 |
11 | import random
12 |
13 | gridpoints = range(128, 400, 16)
14 | canvas = 512 # size of the gif in pixels
15 | margin = 128 # distance from edge of canvas
16 | num_frames = 17 # number of frames in the animation
17 | stepa = -1 # steps in looping animation
18 | stepb = 17
19 |
20 | # draw the canvas
21 | for frame in range(num_frames):
22 | newPage(canvas, canvas)
23 | stepa = stepa + 1
24 | stepb = stepb - 1
25 | frameDuration(1/10)
26 | fill(0.8)
27 | rect(0, 0, canvas, canvas)
28 |
29 | # draw the grid
30 | fill(None)
31 | stroke(0.5)
32 | strokeWidth(1)
33 | lineCap("round")
34 | lineJoin("round")
35 |
36 | # grid X-axis
37 | stepx = -16 # step in sequence on x axis
38 | incx = 16 # grid increment
39 | for x in range(17):
40 | save()
41 | stepx = stepx + incx
42 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
43 | restore()
44 |
45 | # grid Y-axis
46 | stepy = -16 # step in sequence on y axis
47 | incy = 16 # grid increment
48 | for y in range(17):
49 | save()
50 | stepy = stepy + incy
51 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
52 | restore()
53 |
54 | # guides
55 | # stroke(1, 0, 0, 0.4)
56 | # strokeWidth(0.5)
57 | # polygon((0, 128), (512, 128))
58 | # polygon((0, 128+256), (512, 128+256))
59 | # polygon((128, 0), (128, 512))
60 | # polygon((128+256, 0), (128+256, 512))
61 | # polygon((256, 0), (256, 512))
62 | # polygon((0, 256), (512, 256))
63 |
64 | # animation loop
65 | for frame in range(num_frames):
66 | save()
67 | a = gridpoints[stepa]
68 | b = gridpoints[stepb]
69 | fill(1)
70 | strokeWidth(1.5)
71 | stroke(0.5)
72 | oval(a-5, a-5, 10, 10)
73 | oval(b-5, b-5, 10, 10)
74 | restore()
75 |
76 | saveImage("dbe_2016_02_27_v2.gif")
--------------------------------------------------------------------------------
/2016_02/dbe_2016_02_27_v2.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 02/27/16 -- version 2
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | # pep-8 maximum-line-length #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | # setting up the canvas size and main variables
10 |
11 | canvas = 512 # size of the gif in pixels
12 | margin = 128 # distance from edge of canvas
13 | num_frames = 16 # number of frames in the animation
14 | stepa = -1 # steps in looping animation
15 | stepb = 17 # steps in looping animation
16 | stepc = -9 # steps in looping animation
17 | stepd = 8 # steps in looping animation
18 | circle_size = 14 # self explanatory
19 |
20 | # grid increments (16px X 16pc)
21 | gridpoints = range(128, 400, 16)
22 | gridpoints_reverse = gridpoints[::-1]
23 | print gridpoints
24 | print gridpoints_reverse
25 |
26 |
27 | # draw the canvas
28 | for frame in range(num_frames):
29 | newPage(canvas, canvas)
30 | stepa = stepa + 1
31 | stepb = stepb - 1
32 | stepc = stepc + 1
33 | stepd = stepd - 1
34 | frameDuration(1/20)
35 | fill(0.8)
36 | rect(0, 0, canvas, canvas)
37 |
38 | # draw the grid
39 | fill(None)
40 | stroke(0.5)
41 | strokeWidth(1)
42 | lineCap("round")
43 | lineJoin("round")
44 |
45 | # grid X-axis
46 | stepx = -16 # step in sequence on x axis
47 | incx = 16 # grid increment
48 | for x in range(17):
49 | save()
50 | stepx = stepx + incx
51 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
52 | restore()
53 |
54 | # grid Y-axis
55 | stepy = -16 # step in sequence on y axis
56 | incy = 16 # grid increment
57 | for y in range(17):
58 | save()
59 | stepy = stepy + incy
60 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
61 | restore()
62 |
63 | # guides
64 | # stroke(0.4)
65 | # strokeWidth(0.5)
66 | # polygon((0, 128), (512, 128))
67 | # polygon((0, 128+256), (512, 128+256))
68 | # polygon((128, 0), (128, 512))
69 | # polygon((128+256, 0), (128+256, 512))
70 | # polygon((256, 0), (256, 512))
71 | # polygon((0, 256), (512, 256))
72 |
73 | # animation loop
74 | for frame in range(num_frames):
75 | save()
76 | a = gridpoints[stepa]
77 | b = gridpoints[stepb]
78 | c = gridpoints_reverse[stepc]
79 | d = gridpoints_reverse[stepd]
80 | fill(1)
81 | strokeWidth(1.5)
82 | stroke(0.5)
83 |
84 | # outer going in
85 | oval(a-(circle_size/2), a-(circle_size/2), circle_size, circle_size)
86 | oval(b-(circle_size/2), b-(circle_size/2), circle_size, circle_size)
87 | oval(a-(circle_size/2), b-(circle_size/2), circle_size, circle_size)
88 | oval(b-(circle_size/2), a-(circle_size/2), circle_size, circle_size)
89 |
90 | #inner going out
91 | oval(c-(circle_size/2), c-(circle_size/2), circle_size, circle_size)
92 | oval(d-(circle_size/2), 256-(circle_size/2), circle_size, circle_size)
93 | oval(c-(circle_size/2), d-(circle_size/2), circle_size, circle_size)
94 | oval(d-(circle_size/2), 256-(circle_size/2), circle_size, circle_size)
95 |
96 | restore()
97 |
98 | saveImage("dbe_2016_02_27_v2.gif")
--------------------------------------------------------------------------------
/2016_02/dbe_2016_02_28_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 02/29/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | # pep-8 maximum-line-length #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | # setting up the main variables
10 | canvas = 512 # size of the gif in pixels
11 | margin = 128 # grids distance from edge of canvas
12 | increment = 16 # grid increment
13 | num_frames = 17 # number of frames in the animation
14 | step = -1 # steps in looping animation
15 | circle_size = 14 # self explanatory
16 |
17 | # grid increments (16px X 16pc)
18 | gridarray_reg = range(margin, (canvas - margin) + increment, increment)
19 | gridarray_rev = gridarray_reg[::-1]
20 | print gridarray_reg
21 | print gridarray_rev
22 |
23 |
24 | # draw the canvas
25 | for frame in range(num_frames):
26 | newPage(canvas, canvas)
27 | step = step + 1
28 | frameDuration(1/20)
29 | fill(0.8)
30 | rect(0, 0, canvas, canvas)
31 |
32 | # draw the grid
33 | fill(None)
34 | stroke(0.5)
35 | strokeWidth(1)
36 | lineCap("round")
37 | lineJoin("round")
38 |
39 | # grid X-axis
40 | stepx = -16 # step in sequence on x axis
41 | for x in range(17):
42 | save()
43 | stepx = stepx + increment
44 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
45 | restore()
46 |
47 | # grid Y-axis
48 | stepy = -16 # step in sequence on y axis
49 | for y in range(17):
50 | save()
51 | stepy = stepy + increment
52 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
53 | restore()
54 |
55 | # guides
56 | stroke(0.4)
57 | strokeWidth(0.5)
58 | polygon((0, 128), (512, 128))
59 | polygon((0, 128+256), (512, 128+256))
60 | polygon((128, 0), (128, 512))
61 | polygon((128+256, 0), (128+256, 512))
62 | polygon((256, 0), (256, 512))
63 | polygon((0, 256), (512, 256))
64 |
65 | # animation loop
66 | for frame in range(num_frames):
67 | print frame
68 | save()
69 | fill(1)
70 | strokeWidth(1.5)
71 | stroke(0.4)
72 |
73 | # moving circles
74 | w
75 |
76 |
77 |
78 | restore()
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | #oval =
88 | #position = starting positon
89 | #while position <= 18
90 | #for oval in ovals:
91 | #position = position =+1
92 | #else reverse
93 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[0])-(circle_size/2),
94 | circle_size, circle_size)
95 |
96 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[2])-(circle_size/2),
97 | circle_size, circle_size)
98 |
99 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[4])-(circle_size/2),
100 | circle_size, circle_size)
101 |
102 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[6])-(circle_size/2),
103 | circle_size, circle_size)
104 |
105 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[8])-(circle_size/2),
106 | circle_size, circle_size)
107 |
108 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[10])-(circle_size/2),
109 | circle_size, circle_size)
110 |
111 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[12])-(circle_size/2),
112 | circle_size, circle_size)
113 |
114 | oval((gridarray_reg[step])-(circle_size/2), (gridarray_reg[14])-(circle_size/2),
115 | circle_size, circle_size)
116 |
117 | oval((gridarray_rev[step])-(circle_size/2), (gridarray_reg[16])-(circle_size/2),
118 | circle_size, circle_size)
119 |
120 | restore()
121 |
122 | saveImage("dbe_2016_02_29_v1.gif")
--------------------------------------------------------------------------------
/2016_02/dbe_2016_02_29_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 03/01/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/
8 |
9 | import math
10 |
11 | def circle (x, y):
12 | oval((gridarray_reg[step_h])-(circle_size/2),
13 | (gridarray_reg[step_v+move])-(circle_size/2),
14 | circle_size, circle_size)
15 |
16 | def grid (x, y):
17 |
18 | # setting up the main variables
19 | canvas = 512 # size of the gif in pixels
20 | margin = 128 # grids distance from edge of canvas
21 | increment = 16 # grid increment
22 | num_frames = 17 # number of frames in the animation
23 | step_h = -2 # horizontal steps in looping animation
24 | step_v = 0 # vertical steps in looping animation
25 | circle_size = 12 # self explanatory
26 |
27 | # grid increments (16px X 16pc)
28 | gridarray_reg = range(margin, (canvas - margin) + increment, increment)
29 | gridarray_rev = gridarray_reg[::-1]
30 |
31 | # draw the canvas
32 | for frame in range(num_frames):
33 | newPage(canvas, canvas)
34 | step_h = step_h + 1
35 | frameDuration(1/20)
36 | fill(0.8)
37 | rect(0, 0, canvas, canvas)
38 |
39 | # style the grid
40 | fill(None)
41 | stroke(0.5)
42 | strokeWidth(1)
43 | lineCap("round")
44 | lineJoin("round")
45 |
46 | # draw the grid X-axis
47 | stepx = -16 # step in sequence on x axis
48 | for x in range(17):
49 | save()
50 | stepx = stepx + increment
51 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
52 | restore()
53 |
54 | # draw the grid Y-axis
55 | stepy = -16 # step in sequence on y axis
56 | for y in range(17):
57 | save()
58 | stepy = stepy + increment
59 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
60 | restore()
61 |
62 | # animation loop
63 | for frame in range(num_frames):
64 | save()
65 | fill(1)
66 | strokeWidth(1.5)
67 | stroke(0.4)
68 |
69 | # moving circles
70 | if step_h <= 16:
71 | for move in range(17):
72 | step_h = step_h + 1
73 | if step_h <= 16:
74 | oval((gridarray_reg[step_h])-(circle_size/2),
75 | (gridarray_reg[step_v+move])-(circle_size/2),
76 | circle_size, circle_size)
77 | else:
78 | step_h = 0
79 | else:
80 | step_h = 0
81 |
82 | restore()
83 |
84 | saveImage("dbe_2016_02_29_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_01_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 03/01/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | import math
10 | print "start"
11 | def dot(x_pos, y_pos):
12 | x=math.cos(math.radians(y_pos*64))
13 |
14 | print x
15 | fill(1)
16 | stroke(1, 0, 0)
17 | strokeWidth(2)
18 | oval(x_pos, x*64, circle_size, circle_size)
19 |
20 | def grid():
21 | # style the grid
22 | fill(None)
23 | stroke(0.5)
24 | strokeWidth(1)
25 | lineCap("round")
26 | lineJoin("round")
27 | # draw the grid X-axis
28 | stepx = -16 # step in sequence on x axis
29 | for x in range(17):
30 | save()
31 | stepx = stepx + increment
32 | polygon((margin + stepx, margin), (margin+stepx, canvas-margin))
33 | restore()
34 | # draw the grid Y-axis
35 | stepy = -16 # step in sequence on y axis
36 | for y in range(17):
37 | save()
38 | stepy = stepy + increment
39 | polygon((margin, margin + stepy), (canvas-margin, margin+stepy))
40 | restore()
41 |
42 | canvas = 512 # size of the gif in pixels
43 | margin = 128 # grids distance from edge of canvas
44 | increment = 16 # grid increment
45 | num_frames = 17 # number of frames in the animation
46 | step_h = 128 # horizontal steps in looping animation
47 | step_v = 0 # vertical steps in looping animation
48 | circle_size = 12 # self explanatory
49 |
50 | # grid increments (16px X 16pc)
51 | gridarray_reg = range(margin, (canvas - margin) + increment, increment)
52 | gridarray_rev = gridarray_reg[::-1]
53 |
54 | # draw each frame as a new page
55 | for frame in range(num_frames):
56 | newPage(canvas, canvas)
57 | step_h = step_h + 1
58 | frameDuration(1/20)
59 | fill(0.8)
60 | rect(0, 0, canvas, canvas)
61 | grid()
62 | step_v = step_v + 1
63 | translate(0, 256)
64 | dot(step_h, step_v)
65 | print "end"
66 | saveImage("dbe_2016_02_29_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_02_v1.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 03/02/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | import math
10 |
11 | # draw a grid
12 | def grid(increment):
13 | fill(None)
14 | stroke(0.5)
15 | strokeWidth(1)
16 | lineCap("round")
17 | lineJoin("round")
18 |
19 | # draw the grid X-axis
20 | stepx = -increment
21 | for x in range(17):
22 | save()
23 | stepx = stepx + increment
24 | polygon((margin + stepx, margin),
25 | (margin+stepx, canvas-margin))
26 | restore()
27 |
28 | # draw the grid Y-axis
29 | stepy = -increment
30 | for y in range(17):
31 | save()
32 | stepy = stepy + increment
33 | polygon((margin, margin + stepy),
34 | (canvas-margin, margin+stepy))
35 | restore()
36 |
37 | # setting global variables
38 | canvas = 512 # size of the gif in pixels
39 | margin = 128 # grids distance from edge of canvas
40 | increment = 16 # grid increment
41 | num_frames = 90 # number of frames in the animation
42 | circle_size = 12 # self explanatory
43 |
44 | # grid increments (16px X 16pc)
45 | gridarray_reg = range(margin, (canvas - margin) + increment, increment)
46 | gridarray_rev = gridarray_reg[::-1]
47 |
48 | # draw each frame as a new page
49 | print "start"
50 | for frame in range(num_frames):
51 | newPage(canvas, canvas)
52 | frameDuration(1/20)
53 | fill(0.8)
54 | rect(0, 0, canvas, canvas)
55 | grid(increment)
56 | translate(0, 256)
57 |
58 | y = math.sin(math.radians(frame*4))
59 | y = y * 128
60 | y = round(y)
61 | y = int(y)
62 | print (y)
63 | fill(1, 0, 0)
64 | stroke (None)
65 | translate(256, 0)
66 | oval(-6, y-6, circle_size, circle_size)
67 |
68 | print "end"
69 | saveImage("dbe_2016_03_02_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_02_v2.py:
--------------------------------------------------------------------------------
1 | # Eli Heuer's daily DrawBot exercise!
2 | # eliheuer@gmail.com
3 | # 03/02/16 -- version 1
4 | # Made with DrawBot:
5 | # http://www.drawbot.com/
6 |
7 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
8 |
9 | import math
10 |
11 | # draw a grid
12 | def grid(increment):
13 | fill(None)
14 | stroke(0.5)
15 | strokeWidth(1)
16 | lineCap("round")
17 | lineJoin("round")
18 |
19 | # draw the grid X-axis
20 | stepx = -increment
21 | for x in range(17):
22 | save()
23 | stepx = stepx + increment
24 | polygon((margin + stepx, margin),
25 | (margin+stepx, canvas-margin))
26 | restore()
27 |
28 | # draw the grid Y-axis
29 | stepy = -increment
30 | for y in range(17):
31 | stepy = stepy + increment
32 | polygon((margin, margin + stepy),
33 | (canvas-margin, margin+stepy))
34 |
35 | # setting global variables
36 | canvas = 512 # size of the gif in pixels
37 | margin = 128 # grids distance from edge of canvas
38 | increment = 16 # grid increment
39 | num_frames = 90 # number of frames in the animation
40 | circle_size = 12 # self explanatory
41 |
42 | # grid increments (16px X 16pc)
43 | gridarray_reg = range(margin, (canvas - margin) + increment, increment)
44 | gridarray_rev = gridarray_reg[::-1]
45 |
46 | # draw each frame as a new page
47 | print "start"
48 | for frame in range(num_frames):
49 | newPage(canvas, canvas)
50 | frameDuration(1/20)
51 | fill(0.8)
52 | rect(0, 0, canvas, canvas)
53 | grid(increment)
54 | translate(0, 256)
55 |
56 | y = math.sin(math.radians(frame*8))
57 | y = y * 128
58 | y = round(y)
59 | y = int(y)
60 | print (y)
61 | fill(1, 0, 0)
62 | stroke (None)
63 | translate(256, 0)
64 | oval(-6, y-6, circle_size, circle_size)
65 |
66 | print "end"
67 | saveImage("dbe_2016_03_02_v2.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_03_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Drawn on: 03/03/16 -- version 1 #
7 | # Made with DrawBot: http://www.drawbot.com/ #
8 | # #
9 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
10 |
11 | import math
12 |
13 | # dot on a sin loop
14 | def sin_dot(frame):
15 | translate(0, 256)
16 | y = math.sin(math.radians(frame*4))
17 | y = y * 128
18 | y = round(y)
19 | y = int(y)
20 | fill(1, 0, 0)
21 | stroke (None)
22 | translate(256-y, 0)
23 | a_point = (y*pi/8)-6
24 | b_point = (y*pi/4)-6
25 | oval(a_point, b_point, circle_size, circle_size)
26 |
27 | # dot on a cos loop
28 | def cos_dot(frame):
29 | translate(0, 0)
30 | y = math.cos(math.radians(frame*4))
31 | y = y * 32
32 | y = round(y)
33 | y = int(y)
34 | fill(1, 0, 0)
35 | stroke (None)
36 | translate(y, 0)
37 | a_point = (y*pi/16)-6
38 | b_point = (y*pi/4)-6
39 | oval(a_point, b_point, circle_size, circle_size)
40 |
41 | # set up a new frame in the animation
42 | def new_page():
43 | newPage(canvas, canvas)
44 | frameDuration(1/20)
45 | fill(0.8)
46 | rect(0, 0, canvas, canvas)
47 |
48 | # draw a grid
49 | def grid(increment):
50 | fill(None)
51 | stroke(0.5)
52 | strokeWidth(1)
53 | lineCap("round")
54 | lineJoin("round")
55 |
56 | # draw the grid X-axis
57 | stepx = -increment
58 | for x in range(17):
59 | save()
60 | stepx = stepx + increment
61 | polygon((margin + stepx, margin),
62 | (margin+stepx, canvas-margin))
63 | restore()
64 |
65 | # draw the grid Y-axis
66 | stepy = -increment
67 | for y in range(17):
68 | stepy = stepy + increment
69 | polygon((margin, margin + stepy),
70 | (canvas-margin, margin+stepy))
71 |
72 | # setting variables
73 | canvas = 512 # size of the gif in pixels
74 | margin = 128 # grids distance from edge of canvas
75 | increment = 16 # grid increment
76 | num_frames = 90 # number of frames in the animation
77 | circle_size = 12 # self explanatory
78 | step =0
79 |
80 |
81 | # draw each frame as a new page
82 | print "start"
83 | for frame in range(num_frames):
84 | #grid_array_reg = range(margin, (canvas - margin) + increment, increment)
85 | #grid_array_rev = grid_array_reg[::-1]
86 | new_page()
87 | grid(increment)
88 | sin_dot(frame)
89 | cos_dot(frame)
90 |
91 | print "end"
92 | saveImage("dbe_2016_03_03_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_03_v2.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Drawn on: 03/03/16 -- version 2 #
7 | # Made with DrawBot: http://www.drawbot.com/ #
8 | # #
9 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
10 |
11 | import math
12 |
13 | # dot on a sin loop
14 | def sin_dot(frame, power):
15 | translate(0, 256)
16 | y = math.sin(math.radians(frame*4))
17 | y = y * 128
18 | y = round(y)
19 | y = int(y)
20 | fill(1, 0, 0)
21 | stroke (None)
22 | translate(256-y, 0)
23 | a_point = (y*pi/8)-6
24 | b_point = (y*pi/4)-6
25 | oval(a_point, b_point, circle_size, circle_size)
26 |
27 | # dot on a cos loop
28 | def cos_dot(frame, power):
29 | translate(0, 0)
30 | y = math.cos(math.radians(frame*2))
31 | y = y * 128
32 | y = round(y)
33 | y = int(y)
34 | fill(0, 0.3, 1)
35 | stroke (None)
36 | a_point = (y*pi/4)-6
37 | b_point = (y*pi/2)-6
38 | oval(a_point, b_point, circle_size, circle_size)
39 |
40 |
41 | # set up a new frame in the animation
42 | def new_page():
43 | newPage(canvas, canvas)
44 | frameDuration(1/20)
45 | fill(0.8)
46 | rect(0, 0, canvas, canvas)
47 |
48 | # draw a grid
49 | def grid(increment):
50 | fill(None)
51 | stroke(0.5)
52 | strokeWidth(1)
53 | lineCap("round")
54 | lineJoin("round")
55 |
56 | # draw the grid X-axis
57 | stepx = -increment
58 | for x in range(17):
59 | save()
60 | stepx = stepx + increment
61 | polygon((margin + stepx, margin),
62 | (margin+stepx, canvas-margin))
63 | restore()
64 |
65 | # draw the grid Y-axis
66 | stepy = -increment
67 | for y in range(17):
68 | stepy = stepy + increment
69 | polygon((margin, margin + stepy),
70 | (canvas-margin, margin+stepy))
71 |
72 | # setting variables
73 | canvas = 512 # size of the gif in pixels
74 | margin = 128 # grids distance from edge of canvas
75 | increment = 16 # grid increment
76 | num_frames = 180 # number of frames in the animation
77 | circle_size = 12 # self explanatory
78 | step = 0
79 | power = 10
80 |
81 |
82 | # draw each frame as a new page
83 | for frame in range(num_frames):
84 | new_page()
85 | power = power + 10
86 | grid(increment)
87 | sin_dot(frame, power)
88 | cos_dot(frame, power)
89 |
90 | saveImage("dbe_2016_03_03_v2.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_04_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/04/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 |
14 | # draws a new frame in the animation
15 | def new_page():
16 | newPage(canvas, canvas)
17 | frameDuration(1/20)
18 | fill(0.8)
19 | rect(0, 0, canvas, canvas)
20 |
21 | # draws the red dot from to position variables
22 | def red_dot(x_pos, y_pos):
23 | fill(1, 0, 0)
24 | stroke(None)
25 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
26 |
27 | # draws a grid from a given increment
28 | def grid(increment):
29 | fill(None)
30 | stroke(0.5)
31 | strokeWidth(1)
32 |
33 | # draw the grid X-axis
34 | step_x = -increment
35 | for x in range(17):
36 | step_x = step_x + increment
37 | polygon((margin + step_x, margin),
38 | (margin+step_x, canvas-margin))
39 |
40 | # draw the grid Y-axis
41 | step_y = -increment
42 | for y in range(17):
43 | step_y = step_y + increment
44 | polygon((margin, margin + step_y),
45 | (canvas-margin, margin+step_y))
46 |
47 | # setting variables
48 | canvas = 512 # size of the gif in pixels
49 | margin = 128 # grid distance from edge of canvas
50 | increment = 16 # grid increment
51 | num_frames = 180 # number of frames in the animation
52 | circle_size = 12 # self explanatory
53 | center = int(canvas / 2) - 6 # exact center of the image
54 | amp = 128 # short for amplitude
55 | step = 0 # step in the animation
56 |
57 | # draw each frame as a new page
58 | for frame in range(num_frames):
59 | new_page()
60 | grid(increment)
61 | x_pos = math.cos(step) * amp
62 | y_pos = -1 * math.sin(step) * amp
63 | red_dot(x_pos, y_pos)
64 | step += 0.175
65 | step %= 8 * math.pi
66 |
67 | saveImage("dbe_2016_03_04_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_05_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/05/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 | # main variables
14 | canvas = 512 # size of the gif in pixels
15 | num_frames = 64 # number of frames in the animation
16 | center = int(canvas / 2) # exact center of the image
17 |
18 | # gird variables
19 | origin = (128, 128)
20 | width = 256
21 | height = 256
22 | num_horizontal_divisions = 1
23 | num_vertical_divisions = 1
24 |
25 | # draws a new frame in the animation
26 | def new_page():
27 | newPage(canvas, canvas) # new page from canvas variable
28 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
29 | fill(0.1) #dark grey
30 | rect(0, 0, canvas, canvas) # background
31 |
32 | # draws a grid from given arguments
33 | def grid(origin, width, height,
34 | num_horizontal_divisions, num_vertical_divisions):
35 | fill(None)
36 | stroke(0.9) # color
37 | strokeWidth(1)
38 |
39 | translate(*origin)
40 | step_x = 0
41 | increment_x = width / num_horizontal_divisions
42 | for x in range(num_horizontal_divisions + 1):
43 | line((step_x, 0), (step_x, height))
44 | step_x += increment_x
45 |
46 | step_y = 0
47 | increment_y = height / num_vertical_divisions
48 | for y in range(num_vertical_divisions + 1):
49 | line((0, step_y), (width, step_y))
50 | step_y += increment_y
51 |
52 | # draw each frame as a new page
53 | for frame in range(int(num_frames/2)):
54 | new_page()
55 | grid(origin, width, height,
56 | num_horizontal_divisions, num_vertical_divisions)
57 |
58 | fontSize(32)
59 | font("Lydian")
60 | tracking(0)
61 | fill(0.9)
62 | stroke(None)
63 | text("Hello World", (-2, -frame))
64 |
65 | for frame in range(int(num_frames/2)):
66 | new_page()
67 | grid(origin, width, height,
68 | num_horizontal_divisions, num_vertical_divisions)
69 | num_horizontal_divisions += 1
70 | num_vertical_divisions += 1
71 |
72 | # type -- future idea: print out variable data?
73 | fontSize(32)
74 | font("Lydian")
75 | tracking(0)
76 | fill(0.9)
77 | stroke(None)
78 | text("Hello World", (-2, -32))
79 |
80 | saveImage("dbe_2016_03_05_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_06_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/06/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 |
14 | # static variables
15 | canvas = 512 # size of the gif in pixels
16 | num_frames = 63 # number of frames in the animation
17 | center = 256 # exact center of the image
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | num_x_divisions = 8
24 | num_y_divisions = 8
25 |
26 | # red dot variables
27 | circle_size = 12 # self explanatory
28 | amp = 64 # short for amplitude
29 | step = 0 # step in the animation
30 | x_pos = 0 # x-axis position
31 | y_pos = 0 # y-axis position
32 |
33 |
34 | # draws a new frame in the animation
35 | def new_page():
36 | newPage(canvas, canvas) # new page from canvas variable
37 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
38 | fill(0.1) #dark grey
39 | rect(0, 0, canvas, canvas) # background
40 |
41 | # draws the red dot from to position variables
42 | def red_dot(x_pos, y_pos):
43 | fill(1, 0, 0)
44 | stroke(None)
45 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
46 |
47 | # draws the red dot from to position variables
48 | def yellow_dot(x_pos, y_pos):
49 | fill(1, 1, 0)
50 | stroke(None)
51 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
52 |
53 | # draws the red dot from to position variables
54 | def blue_dot(x_pos, y_pos):
55 | fill(0, 0, 1)
56 | stroke(None)
57 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
58 |
59 | # draws a grid from given arguments
60 | def grid(origin, width, height, num_x_divisions, num_y_divisions):
61 | fill(None)
62 | stroke(0.9) # color
63 | strokeWidth(1)
64 |
65 | translate(*origin)
66 | step_x = 0
67 | increment_x = width / num_x_divisions
68 | for x in range(num_x_divisions + 1):
69 | line((step_x, 0), (step_x, height))
70 | step_x += increment_x
71 |
72 | step_y = 0
73 | increment_y = height / num_y_divisions
74 | for y in range(num_y_divisions + 1):
75 | line((0, step_y), (width, step_y))
76 | step_y += increment_y
77 |
78 | # draw each frame as a new page
79 | for frame in range(int(num_frames)):
80 | new_page()
81 |
82 | # draw the grid
83 | grid(origin, width, height, num_x_divisions, num_y_divisions)
84 |
85 | # type -- future idea: print out variable data?
86 | fontSize(32)
87 | font("Helvetica Neue Bold")
88 | tracking(2)
89 | fill(0.9)
90 | stroke(None)
91 | text("Hello World", (-2, -32))
92 |
93 | # animated dot
94 | x_pos = math.cos(step) * amp
95 | y_pos = -1 * math.sin(step) * amp
96 |
97 | red_dot((x_pos/2)-6, (y_pos/2)-6)
98 | yellow_dot(0-6, 0-6)
99 | blue_dot((x_pos)-6, (y_pos)-6)
100 |
101 | step += 0.1
102 | step %= 8 * math.pi
103 |
104 | saveImage("dbe_2016_03_06_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_07_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/07/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 |
14 | # static variables
15 | canvas = 512 # size of the gif in pixels
16 | num_frames = 122 # number of frames in the animation
17 | center = 128 # exact center of the image
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | num_x_divisions = 8
24 | num_y_divisions = 8
25 |
26 | # red dot variables
27 | circle_size = 16 # self explanatory
28 | amp = 64 # short for amplitude
29 | step = 0 # step in the animation
30 | x_pos = 0 # x-axis position
31 | y_pos = 0 # y-axis position
32 | spacing = 0
33 |
34 |
35 | # draws a new frame in the animation
36 | def new_page():
37 | newPage(canvas, canvas) # new page from canvas variable
38 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
39 | fill(0.1) #dark grey
40 | rect(0, 0, canvas, canvas) # background
41 |
42 | # draws the red dot from to position variables
43 | def red_dot(x_pos, y_pos):
44 | fill(1, 0, 0)
45 | stroke(None)
46 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
47 |
48 | # draws the red dot from to position variables
49 | def yellow_dot(x_pos, y_pos):
50 | fill(1, 1, 0)
51 | stroke(None)
52 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
53 |
54 | # draws the red dot from to position variables
55 | def blue_dot(x_pos, y_pos):
56 | fill(0, 0.2, 1)
57 | stroke(None)
58 | oval(int(x_pos) + center, int(y_pos) + center, circle_size, circle_size)
59 |
60 | # draws a grid from given arguments
61 | def grid(origin, width, height, num_x_divisions, num_y_divisions):
62 | fill(None)
63 | stroke(0.9) # color
64 | strokeWidth(1)
65 |
66 | translate(*origin)
67 | step_x = 0
68 | increment_x = width / num_x_divisions
69 | for x in range(num_x_divisions + 1):
70 | line((step_x, 0), (step_x, height))
71 | step_x += increment_x
72 |
73 | step_y = 0
74 | increment_y = height / num_y_divisions
75 | for y in range(num_y_divisions + 1):
76 | line((0, step_y), (width, step_y))
77 | step_y += increment_y
78 |
79 | # draw each frame as a new page
80 | for frame in range(int(num_frames/2)):
81 | new_page()
82 |
83 | # draw the grid
84 | grid(origin, width, height, num_x_divisions, num_y_divisions)
85 |
86 | # type -- future idea: print out variable data?
87 | spacing += 0.28
88 | fontSize(32)
89 | font("Helvetica Neue Bold")
90 | tracking(-1.2)
91 | fill(0.9)
92 | stroke(None)
93 | text("Hello World", (-2, -160+(frame*9)))
94 |
95 | # animated dot
96 | x_pos = math.cos(step) * amp
97 | y_pos = -1 * math.sin(step) * amp
98 |
99 | red_dot((x_pos)-8, (y_pos)-8)
100 | yellow_dot(0-8, 0-8)
101 | blue_dot((x_pos*2)-8, (y_pos*2)-8)
102 |
103 | step += 0.2
104 | step %= 8 * math.pi
105 |
106 | yellow_dot(0-8, 0-8)
107 |
108 | saveImage("dbe_2016_03_07_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_08_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/08/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 |
14 | # static variables
15 | canvas = 512 # size of the gif in pixels
16 | num_frames = 16 # number of frames in the animation
17 | center = 128 # exact center of the image
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | num_x_divisions = 1
24 | num_y_divisions = 1
25 |
26 | # red dot variables
27 | circle_size = 256
28 | amp = 64 # short for amplitude
29 | step = 0 # step in the animation
30 | x_pos = 0 # x-axis position
31 | y_pos = 0 # y-axis position
32 |
33 | # draws a new frame in the animation
34 | def new_page():
35 | newPage(canvas, canvas) # new page from canvas variable
36 | frameDuration(1/1) # set the dividend to desired FPS (frames per second)
37 | fill(0.0, 0.0, 0.1) #dark grey
38 | rect(0, 0, canvas, canvas) # background
39 |
40 | # draws the red dot from to position variables
41 | def red_dot(x_pos, y_pos, circle_size):
42 | fill(1, 0, 0)
43 | stroke(None)
44 | oval(int(x_pos), int(y_pos), circle_size, circle_size)
45 |
46 | # draws a grid from given arguments
47 | def grid(origin, width, height, num_x_divisions, num_y_divisions):
48 | fill(None)
49 | stroke(1, 0, 0) # color
50 | strokeWidth(1)
51 |
52 | translate(*origin)
53 | step_x = 0
54 | increment_x = width / num_x_divisions
55 | for x in range(num_x_divisions + 1):
56 | line((step_x, 0), (step_x, height))
57 | step_x += increment_x
58 |
59 | step_y = 0
60 | increment_y = height / num_y_divisions
61 | for y in range(num_y_divisions + 1):
62 | line((0, step_y), (width, step_y))
63 | step_y += increment_y
64 |
65 | # draw each frame as a new page
66 | for frame in range(8):
67 | new_page()
68 | step =+ 1
69 | # draw the grid
70 | grid(origin, width, height, num_x_divisions, num_y_divisions)
71 | num_x_divisions += 1
72 | num_y_divisions += 1
73 | # animated dot
74 | red_dot(x_pos, y_pos, circle_size)
75 | circle_size = width / num_x_divisions
76 |
77 | for frame in range(8):
78 | new_page()
79 | step =+ 1
80 | # draw the grid
81 | grid(origin, width, height, num_x_divisions, num_y_divisions)
82 | num_x_divisions -= 1
83 | num_y_divisions -= 1
84 | # animated dot
85 | red_dot(x_pos, y_pos, circle_size)
86 | circle_size = width / num_x_divisions
87 |
88 | saveImage("dbe_2016_03_08_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_09_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/09/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | import math # for cos and sin functions
13 |
14 | # static variables
15 | canvas = 512 # size of the gif in pixels
16 | num_frames = 16 # number of frames in the animation
17 | center = 128 # exact center of the image
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | num_x_divisions = 16
24 | num_y_divisions = 16
25 |
26 | x_pos = 128+64
27 | y_pos = 128-32
28 | wedge_color_r = 1
29 | wedge_color_g = 1
30 | wedge_color_b = 0
31 |
32 | # draws a new frame in the animation
33 | def new_page():
34 | newPage(canvas, canvas) # new page from canvas variable
35 | frameDuration(1/4) # set the dividend to desired FPS (frames per second)
36 | fill(0.7, 0.7, 0.7) #dark grey
37 | rect(0, 0, canvas, canvas) # background
38 |
39 | # draws a grid from given arguments
40 | def grid(origin, width, height, num_x_divisions, num_y_divisions):
41 | fill(None)
42 | stroke(0.1, 0.1, 0.1) # color
43 | strokeWidth(1)
44 |
45 | translate(*origin)
46 | step_x = 0
47 | increment_x = width / num_x_divisions
48 | for x in range(num_x_divisions + 1):
49 | line((step_x, 0), (step_x, height))
50 | step_x += increment_x
51 |
52 | step_y = 0
53 | increment_y = height / num_y_divisions
54 | for y in range(num_y_divisions + 1):
55 | line((0, step_y), (width, step_y))
56 | step_y += increment_y
57 |
58 | # draw each frame as a new page
59 | for frame in range(num_frames):
60 | new_page()
61 |
62 | # draw the grid
63 | grid(origin, width, height, num_x_divisions, num_y_divisions)
64 |
65 |
66 | translate(0, 256)
67 | stroke(0.1, 0.1, 0.1)
68 |
69 | if frame >= 1:
70 | fill(0.9, 0.2, 0.2)
71 | rotate(-90)
72 | translate(64, 64)
73 | polygon((0, 0), (32, 32), (0, 64), close=True)
74 |
75 | if frame >= 2:
76 | fill(0.9, 0.5, 0.2)
77 | rotate(180)
78 | translate(-32, -96)
79 | polygon((0, 0), (32, 32), (0, 64), close=True)
80 |
81 | if frame >= 3:
82 | fill(0.9, 0.9, 0.2)
83 | rotate(180)
84 | translate(-32, -32)
85 | polygon((0, 0), (32, 32), (0, 64), close=True)
86 |
87 | if frame >= 4:
88 | fill(0.5, 0.9, 0.2)
89 | rotate(-90)
90 | translate(-64, 0)
91 | polygon((0, 0), (32, 32), (0, 64), close=True)
92 |
93 | if frame >= 5:
94 | fill(0.2, 0.9, 0.2)
95 | rotate(180)
96 | translate(-32, -96)
97 | polygon((0, 0), (32, 32), (0, 64), close=True)
98 |
99 | if frame >= 6:
100 | fill(0.2, 0.9, 0.5)
101 | rotate(180)
102 | translate(-32, -32)
103 | polygon((0, 0), (32, 32), (0, 64), close=True)
104 |
105 | if frame >= 7:
106 | fill(0.2, 0.9, 0.9)
107 | rotate(-90)
108 | translate(-64, 0)
109 | polygon((0, 0), (32, 32), (0, 64), close=True)
110 |
111 | if frame >= 8:
112 | fill(0.2, 0.5, 0.9)
113 | rotate(180)
114 | translate(-32, -96)
115 | polygon((0, 0), (32, 32), (0, 64), close=True)
116 |
117 | if frame >= 9:
118 | fill(0.2, 0.2, 0.9)
119 | rotate(180)
120 | translate(-32, -32)
121 | polygon((0, 0), (32, 32), (0, 64), close=True)
122 |
123 | if frame >= 10:
124 | fill(0.5, 0.2, 0.9)
125 | rotate(-90)
126 | translate(-64, 0)
127 | polygon((0, 0), (32, 32), (0, 64), close=True)
128 |
129 | if frame >= 11:
130 | fill(0.9, 0.2, 0.9)
131 | rotate(180)
132 | translate(-32, -96)
133 | polygon((0, 0), (32, 32), (0, 64), close=True)
134 |
135 | if frame >= 12:
136 | fill(0.9, 0.2, 0.5)
137 | rotate(180)
138 | translate(-32, -32)
139 | polygon((0, 0), (32, 32), (0, 64), close=True)
140 |
141 | saveImage("dbe_2016_03_08_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_10_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/10/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # setting variables
13 | canvas = 512 # size of the gif in pixels
14 | center = int(canvas / 2) - 6 # exact center of the image
15 |
16 | bar_range_up = range(0, 264, 8)
17 | bar_range_down = range(248, 0, -8)
18 | bar_range = bar_range_up + bar_range_down
19 | num_frames = len(bar_range) # number of frames = length of bar_range list
20 | print bar_range
21 | print len(bar_range)
22 |
23 | red_bar_range = [32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24]
24 |
25 | orange_bar_range = [64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56]
26 |
27 | yellow_bar_range= [96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88]
28 |
29 | lightgreen_bar_range = [128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120]
30 |
31 | darkgreen_bar_range = [160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152]
32 |
33 | lightblue_bar_range = [192, 200, 208, 216, 224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184]
34 |
35 | darkblue_bar_range = [224, 232, 240, 248, 256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216]
36 |
37 | purple_bar_range = [256, 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248]
38 |
39 | # gird variables
40 | origin = (128, 128)
41 | width = 256
42 | height = 256
43 | num_x_divisions = 8
44 | num_y_divisions = 8
45 | bar_size = width / num_x_divisions
46 |
47 | red_bar_x_pos = 0
48 | red_bar_y_pos = 0
49 | red_step = 0
50 | red_bar_x_size = width/num_x_divisions
51 |
52 | orange_bar_x_pos = bar_size*1
53 | orange_bar_y_pos = 0
54 | orange_step = 0
55 | orange_bar_x_size = width/num_x_divisions
56 |
57 | yellow_bar_x_pos = bar_size*2
58 | yellow_bar_y_pos = 0
59 | yellow_step = 0
60 | yellow_bar_x_size = width/num_x_divisions
61 |
62 | lightgreen_bar_x_pos = bar_size*3
63 | lightgreen_bar_y_pos = 0
64 | lightgreen_step = 0
65 | lightgreen_bar_x_size = width/num_x_divisions
66 |
67 | darkgreen_bar_x_pos = bar_size*4
68 | darkgreen_bar_y_pos = 0
69 | darkgreen_step = 0
70 | darkgreen_bar_x_size = width/num_x_divisions
71 |
72 | lightblue_bar_x_pos = bar_size*5
73 | lightblue_bar_y_pos = 0
74 | lightblue_step = 0
75 | lightblue_bar_x_size = width/num_x_divisions
76 |
77 | darkblue_bar_x_pos = bar_size*6
78 | darkblue_bar_y_pos = 0
79 | darkblue_step = 0
80 | darkblue_bar_x_size = width/num_x_divisions
81 |
82 | purple_bar_x_pos = bar_size*7
83 | purple_bar_y_pos = 0
84 | purple_step = 0
85 | purple_bar_x_size = width/num_x_divisions
86 |
87 | # draws a new frame in the animation
88 | def new_page():
89 | newPage(canvas, canvas) # new page from canvas variable
90 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
91 | fill(0.7, 0.7, 0.7)
92 | rect(0, 0, canvas, canvas) # background
93 |
94 | # draws a grid from given arguments
95 | def grid(origin, width, height, num_x_divisions, num_y_divisions):
96 | fill(None)
97 | stroke(0.2) # color
98 | strokeWidth(1)
99 |
100 | translate(*origin)
101 | step_x = 0
102 | increment_x = width / num_x_divisions
103 | for x in range(num_x_divisions + 1):
104 | line((step_x, 0), (step_x, height))
105 | step_x += increment_x
106 |
107 | step_y = 0
108 | increment_y = height / num_y_divisions
109 | for y in range(num_y_divisions + 1):
110 | line((0, step_y), (width, step_y))
111 | step_y += increment_y
112 |
113 | # draws the red dot from to position variables
114 | def red_bar(red_bar_x_pos, red_bar_y_pos,
115 | red_bar_x_size, red_bar_y_size):
116 | fill(0.9, 0.2, 0.1)
117 | stroke(0.2)
118 | rect(red_bar_x_pos, red_bar_y_pos,
119 | red_bar_x_size, red_bar_y_size)
120 |
121 | def orange_bar(orange_bar_x_pos, orange_bar_y_pos,
122 | orange_bar_x_size, orange_bar_y_size):
123 | fill(0.9, 0.4, 0.1)
124 | stroke(0.2)
125 | rect(orange_bar_x_pos, orange_bar_y_pos,
126 | orange_bar_x_size, orange_bar_y_size)
127 |
128 | def yellow_bar(yellow_bar_x_pos, yellow_bar_y_pos,
129 | yellow_bar_x_size, yellow_bar_y_size):
130 | fill(0.9, 0.9, 0.1)
131 | stroke(0.2)
132 | rect(yellow_bar_x_pos, yellow_bar_y_pos,
133 | yellow_bar_x_size, yellow_bar_y_size)
134 |
135 | def lightgreen_bar(lightgreen_bar_x_pos, lightgreen_bar_y_pos,
136 | lightgreen_bar_x_size, lightgreen_bar_y_size):
137 | fill(0.2, 0.8, 0.1)
138 | stroke(0.2)
139 | rect(lightgreen_bar_x_pos, lightgreen_bar_y_pos,
140 | lightgreen_bar_x_size, lightgreen_bar_y_size)
141 |
142 | def darkgreen_bar(darkgreen_bar_x_pos, darkgreen_bar_y_pos,
143 | darkgreen_bar_x_size, darkgreen_bar_y_size):
144 | fill(0.1, 0.6, 0.9)
145 | stroke(0.2)
146 | rect(darkgreen_bar_x_pos, darkgreen_bar_y_pos,
147 | darkgreen_bar_x_size, darkgreen_bar_y_size)
148 |
149 | def lightblue_bar(lightblue_bar_x_pos, lightblue_bar_y_pos,
150 | lightblue_bar_x_size, lightblue_bar_y_size):
151 | fill(0.1, 0.3, 0.9)
152 | stroke(0.2)
153 | rect(lightblue_bar_x_pos, lightblue_bar_y_pos,
154 | lightblue_bar_x_size, lightblue_bar_y_size)
155 |
156 | def darkblue_bar(darkblue_bar_x_pos, darkblue_bar_y_pos,
157 | darkblue_bar_x_size, darkblue_bar_y_size):
158 | fill(0.5, 0.1, 0.9)
159 | stroke(0.2)
160 | rect(darkblue_bar_x_pos, darkblue_bar_y_pos,
161 | darkblue_bar_x_size, darkblue_bar_y_size)
162 |
163 | def purple_bar(purple_bar_x_pos, purple_bar_y_pos,
164 | purple_bar_x_size, purple_bar_y_size):
165 | fill(0.85, 0.1, 0.7)
166 | stroke(0.2)
167 | rect(purple_bar_x_pos, purple_bar_y_pos,
168 | purple_bar_x_size, purple_bar_y_size)
169 |
170 | # draw each frame as a new page
171 | for frame in range(num_frames):
172 | new_page()
173 |
174 | # draw the grid
175 | grid(origin, width, height, num_x_divisions, num_y_divisions)
176 |
177 | # type -- future idea: print out variable data?
178 | fontSize(32)
179 | font("Helvetica Neue Bold")
180 | tracking(-1.2)
181 | fill(0.2)
182 | stroke(None)
183 | text("Hello World", (-2, -32))
184 |
185 | red_bar_y_size = red_bar_range[red_step]
186 | orange_bar_y_size = orange_bar_range[orange_step]
187 | yellow_bar_y_size = yellow_bar_range[yellow_step]
188 | lightgreen_bar_y_size = lightgreen_bar_range[lightgreen_step]
189 | darkgreen_bar_y_size = darkgreen_bar_range[darkgreen_step]
190 | lightblue_bar_y_size = lightblue_bar_range[lightblue_step]
191 | darkblue_bar_y_size = darkblue_bar_range[darkblue_step]
192 | purple_bar_y_size = purple_bar_range[purple_step]
193 |
194 | red_bar(red_bar_x_pos, red_bar_y_pos,
195 | red_bar_x_size, red_bar_y_size)
196 | red_step += 1
197 |
198 | orange_bar(orange_bar_x_pos, orange_bar_y_pos,
199 | orange_bar_x_size, orange_bar_y_size)
200 | orange_step += 1
201 |
202 | yellow_bar(yellow_bar_x_pos, yellow_bar_y_pos,
203 | yellow_bar_x_size, yellow_bar_y_size)
204 | yellow_step += 1
205 |
206 | lightgreen_bar(lightgreen_bar_x_pos, lightgreen_bar_y_pos,
207 | lightgreen_bar_x_size, lightgreen_bar_y_size)
208 | lightgreen_step += 1
209 |
210 | darkgreen_bar(darkgreen_bar_x_pos, darkgreen_bar_y_pos,
211 | darkgreen_bar_x_size, darkgreen_bar_y_size)
212 | darkgreen_step += 1
213 |
214 | lightblue_bar(lightblue_bar_x_pos, lightblue_bar_y_pos,
215 | lightblue_bar_x_size, lightblue_bar_y_size)
216 | lightblue_step += 1
217 |
218 | darkblue_bar(darkblue_bar_x_pos, darkblue_bar_y_pos,
219 | darkblue_bar_x_size, darkblue_bar_y_size)
220 | darkblue_step += 1
221 |
222 | purple_bar(purple_bar_x_pos, purple_bar_y_pos,
223 | purple_bar_x_size, purple_bar_y_size)
224 | purple_step += 1
225 |
226 | saveImage("dbe_2016_03_10_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_10_v2.py:
--------------------------------------------------------------------------------
1 |
2 | import math # for cos and sin functions
3 |
4 | # static variables
5 | canvas = 512 # size of the gif in pixels
6 | num_frames = 16 # number of frames in the animation
7 |
8 | # draws a new frame in the animation
9 | def new_page():
10 | newPage(canvas, canvas) # new page from canvas variable
11 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
12 | fill(0.7, 0.7, 0.7) #dark grey
13 | rect(0, 0, canvas, canvas) # background
14 |
15 | def fib(n):
16 | stroke(1)
17 | line((0, 0), (30, 0))
18 | turtle.forward(30)
19 |
20 | if n<2:
21 | pass
22 | else:
23 | line((0, 0), (30, 0))
24 | fib(n-1)
25 | line((0, 0), (30, 30))
26 | fib(n-2)
27 | line((0, 0), (30, 30))
28 |
29 | translate(30, 30)
30 |
31 | # draw each frame as a new page
32 | for frame in range(num_frames):
33 | new_page()
34 | fib(10)
35 |
36 | saveImage("dbe_2016_03_10_v2.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_11_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/11/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos and sin functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 32 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # red dot variables
28 | dot_size = 32
29 | amp = 80 # short for amplitude
30 | step = 0 # step in the animation
31 | x_pos = 0 # x-axis position
32 | y_pos = 0 # y-axis position
33 |
34 | # draws a new frame in the animation
35 | def new_page():
36 | newPage(canvas, canvas) # new page from canvas variable
37 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
38 | fill(0.1) # color of background
39 | rect(0, 0, canvas, canvas) # draw the background
40 |
41 | # draws the red dot from two position variables
42 | def red_dot(x_pos, y_pos):
43 | fill(1, 0, 0)
44 | stroke(None)
45 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
46 |
47 | # draws a grid from given arguments
48 | def grid(origin, width, height, num_x_units, num_y_units):
49 | translate(*origin)
50 | strokeWidth(1)
51 | stroke(0.7)
52 | fill(None)
53 |
54 | step_x = 0
55 | unit_x = width / num_x_units
56 | for x in range(num_x_units + 1):
57 | line((step_x, 0), (step_x, height))
58 | step_x += unit_x
59 |
60 | step_y = 0
61 | unit_y = height / num_y_units
62 | for y in range(num_y_units + 1):
63 | line((0, step_y), (width, step_y))
64 | step_y += unit_y
65 |
66 | # draw each frame as a new page
67 | for frame in range(num_frames):
68 | new_page()
69 | grid(origin, width, height, num_x_units, num_y_units)
70 |
71 | # animated dot
72 | x_pos = math.cos(step/2) * amp
73 | y_pos = -1 * math.sin(step) * amp/2
74 |
75 | red_dot((x_pos)-dot_size/2, (y_pos)-dot_size/2)
76 | step += 0.4
77 | step %= 8 * math.pi
78 |
79 | saveImage("dbe_2016_03_11_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_12_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/12/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos and sin functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 64 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # red dot variables
28 | dot_size = 32
29 | amp = 80 # short for amplitude
30 | step = 0 # step in the animation
31 | x_pos = 0 # x-axis position
32 | y_pos = 0 # y-axis position
33 | r = 0.2
34 | g = 0.2
35 | b = 0.2
36 | r_array = range(-1600, 10000, 16)
37 | g_array = range(-1600, 10000, 16)
38 | b_array = range(-1600, 10000, 16)
39 | print "r_array: ", r_array
40 | color_cycle = 0
41 |
42 | # draws a new frame in the animation
43 | def new_page():
44 | newPage(canvas, canvas) # new page from canvas variable
45 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
46 | fill(0.1) # color of background
47 | rect(0, 0, canvas, canvas) # draw the background
48 |
49 | # draws the red dot from two position variables
50 | def red_dot(x_pos, y_pos, r, b, g):
51 | fill(r, g, b)
52 | stroke(None)
53 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
54 |
55 | # draws a grid from given arguments
56 | def grid(origin, width, height, num_x_units, num_y_units):
57 | translate(*origin)
58 | strokeWidth(1)
59 | stroke(0.7)
60 | fill(None)
61 |
62 | step_x = 0
63 | unit_x = width / num_x_units
64 | for x in range(num_x_units + 1):
65 | line((step_x, 0), (step_x, height))
66 | step_x += unit_x
67 |
68 | step_y = 0
69 | unit_y = height / num_y_units
70 | for y in range(num_y_units + 1):
71 | line((0, step_y), (width, step_y))
72 | step_y += unit_y
73 |
74 | # draw each frame as a new page
75 | for frame in range(num_frames):
76 | new_page()
77 | grid(origin, width, height, num_x_units, num_y_units)
78 |
79 | # animated dot
80 | for sub_frame in range(num_frames*8):
81 | r = r_array[sub_frame] * 0.0001
82 | g = g_array[sub_frame] * 0.0001
83 | b = g_array[sub_frame] * 0.0001
84 | color_cycle += 1
85 | x_pos = math.cos(step/2) * amp*2
86 | y_pos = -1 * math.sin(step) * amp/2
87 |
88 | red_dot((x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
89 | step += 0.1001
90 | step %= 8 * math.pi
91 |
92 | saveImage("dbe_2016_03_12_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_13_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/13/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos and sin functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 100 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # red dot variables
28 | dot_size = 32
29 | amp = 80 # short for amplitude
30 | step = 0 # step in the animation
31 | x_pos = 0 # x-axis position
32 | y_pos = 0 # y-axis position
33 | r = 0.2
34 | g = 0.2
35 | b = 0.2
36 | r_array = range(0, 1024, 1)
37 | g_array = range(0, 1024, 1)
38 | b_array = range(0, 1024, 1)
39 | print "r_array: ", r_array
40 | color_cycle = 0
41 | step_step = 0
42 |
43 | # draws a new frame in the animation
44 | def new_page():
45 | newPage(canvas, canvas) # new page from canvas variable
46 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
47 | fill(0.1) # color of background
48 | rect(0, 0, canvas, canvas) # draw the background
49 |
50 | # draws the dot from two position variables
51 | def dot(x_pos, y_pos, r, b, g):
52 | fill(r, g, b)
53 | stroke(None)
54 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
55 |
56 | # draws a grid from given arguments
57 | def grid(origin, width, height, num_x_units, num_y_units):
58 | translate(*origin)
59 | strokeWidth(1)
60 | stroke(0.7)
61 | fill(None)
62 |
63 | step_x = 0
64 | unit_x = width / num_x_units
65 | for x in range(num_x_units + 1):
66 | line((step_x, 0), (step_x, height))
67 | step_x += unit_x
68 |
69 | step_y = 0
70 | unit_y = height / num_y_units
71 | for y in range(num_y_units + 1):
72 | line((0, step_y), (width, step_y))
73 | step_y += unit_y
74 |
75 | # draw each frame as a new page
76 | for frame in range(num_frames):
77 | new_page()
78 | grid(origin, width, height, num_x_units, num_y_units)
79 |
80 | # animated dot
81 | for sub_frame in range(num_frames):
82 | r = g_array[sub_frame] * 0.004
83 | g = 0.4
84 | b = g_array[sub_frame] * 0.02
85 | color_cycle += 1
86 | x_pos = math.cos(step) * amp
87 | y_pos = -1 * math.sin(step) * amp
88 |
89 | dot((x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
90 |
91 | step += step_step
92 | step_step += 0.000002 * math.pi
93 | step %= 8 * math.pi
94 |
95 | saveImage("dbe_2016_03_13_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_14_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: Pi Day! 03/14/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos and sin functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 100 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # red dot variables
28 | dot_size = 16
29 | amp = 128 # short for amplitude
30 | step = 0 # step in the animation
31 | step_string = "{:.6f}".format(step)
32 | x_pos = 0 # x-axis position
33 | y_pos = 0 # y-axis position
34 | r = 1
35 | g = 1
36 | b = 1
37 |
38 | # draws a new frame in the animation
39 | def new_page():
40 | newPage(canvas, canvas) # new page from canvas variable
41 | frameDuration(1/20) # set the dividend to desired FPS (frames per second)
42 | fill(0.1) # color of background
43 | rect(0, 0, canvas, canvas) # draw the background
44 |
45 | # draws the dot from two position variables
46 | def dot(x_pos, y_pos, r, b, g):
47 | fill(1, 0, 0)
48 | stroke(None)
49 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
50 |
51 | # draws a guide showing the sine of dot
52 | def sine_lines(width, height, x_pos, y_pos, r, b, g):
53 | fill(r, g, b)
54 | stroke(None)
55 | oval(center-dot_size/2, center-dot_size/2, dot_size, dot_size)
56 | oval(int(x_pos) + center, center-dot_size/2, dot_size, dot_size)
57 | fill(None)
58 | strokeWidth(3)
59 | stroke(r, g, b)
60 | line((center, center),
61 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
62 | line((center, center),
63 | (int(x_pos) + (center+dot_size/2), center))
64 | line((int(x_pos) + (center+dot_size/2), center),
65 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
66 | oval(center-128, center-128, width, height)
67 |
68 | # draws a grid from given arguments
69 | def grid(origin, width, height, num_x_units, num_y_units):
70 | translate(*origin)
71 | strokeWidth(1)
72 | stroke(0.5)
73 | fill(None)
74 |
75 | step_x = 0
76 | unit_x = width / num_x_units
77 | for x in range(num_x_units + 1):
78 | line((step_x, 0), (step_x, height))
79 | step_x += unit_x
80 |
81 | step_y = 0
82 | unit_y = height / num_y_units
83 | for y in range(num_y_units + 1):
84 | line((0, step_y), (width, step_y))
85 | step_y += unit_y
86 |
87 | # draw each frame as a new page
88 | for frame in range(num_frames):
89 | new_page()
90 | grid(origin, width, height, num_x_units, num_y_units)
91 |
92 | # animated dot
93 | x_pos = math.cos(step) * amp
94 | y_pos = -1 * math.sin(step) * amp
95 | x_pos_string = "{:.3f}".format(x_pos)
96 | y_pos_string = "{:.3f}".format(y_pos)
97 | print "x position: ", x_pos_string
98 | print "y position: ", y_pos_string
99 |
100 | sine_lines(width, height, (x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
101 | dot((x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
102 |
103 | # type
104 | fontSize(24)
105 | font("Helvetica Neue Bold")
106 | tracking(0)
107 | fill(1, 1, 1)
108 | stroke(None)
109 | text("Happy π Day", (-2, -32))
110 | fill(1, 0, 0)
111 | text(step_string, (-2, -64))
112 |
113 | step += 0.02 * math.pi
114 | step_string = "{:.8f}".format(step)
115 |
116 | saveImage("dbe_2016_03_14_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_14_v2.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: Pi Day! 03/14/16 -- version 2 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos, sin and pi functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 100 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # dot variables
28 | dot_size = 16
29 | amp = 128 # short for amplitude
30 | step = 0 # step in the animation
31 | fake_step = math.pi # a dumb hack >_<
32 | step_string = "{:.8f}".format(fake_step)
33 | x_pos = 0 # x-axis position
34 | y_pos = 0 # y-axis position
35 | r = 1
36 | g = 1
37 | b = 1
38 |
39 | # draws a new frame in the animation
40 | def new_page():
41 | newPage(canvas, canvas) # new page from canvas variable
42 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
43 | fill(0.1) # color of background
44 | rect(0, 0, canvas, canvas) # draw the background
45 |
46 | # draws the dot from two position variables
47 | def dot(x_pos, y_pos, r, b, g):
48 | fill(1, 0, 0)
49 | stroke(None)
50 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
51 |
52 | # draws a guide showing the sine of dot
53 | def sine_lines(width, height, x_pos, y_pos, r, b, g):
54 | fill(r, g, b)
55 | stroke(None)
56 | oval(center-dot_size/2, center-dot_size/2, dot_size, dot_size)
57 | oval(int(x_pos) + center, center-dot_size/2, dot_size, dot_size)
58 | fill(None)
59 | strokeWidth(3)
60 | stroke(r, g, b)
61 | line((center, center),
62 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
63 | line((center, center),
64 | (int(x_pos) + (center+dot_size/2), center))
65 | line((int(x_pos) + (center+dot_size/2), center),
66 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
67 | oval(center-128, center-128, width, height)
68 |
69 | # draws a grid from given arguments
70 | def grid(origin, width, height, num_x_units, num_y_units):
71 | translate(*origin)
72 | strokeWidth(1)
73 | stroke(0.5)
74 | fill(None)
75 |
76 | step_x = 0
77 | unit_x = width / num_x_units
78 | for x in range(num_x_units + 1):
79 | line((step_x, 0), (step_x, height))
80 | step_x += unit_x
81 |
82 | step_y = 0
83 | unit_y = height / num_y_units
84 | for y in range(num_y_units + 1):
85 | line((0, step_y), (width, step_y))
86 | step_y += unit_y
87 |
88 | # draw each frame as a new page
89 | for frame in range(num_frames):
90 | new_page()
91 | grid(origin, width, height, num_x_units, num_y_units)
92 |
93 | # animated dot
94 | x_pos = math.cos(step) * amp
95 | y_pos = -1 * math.sin(step) * amp
96 | x_pos_string = "{:.3f}".format(x_pos)
97 | y_pos_string = "{:.3f}".format(y_pos)
98 | print "x position: ", x_pos_string
99 | print "y position: ", y_pos_string
100 |
101 | sine_lines(width, height, (x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
102 | dot((x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
103 |
104 | # type
105 | fontSize(24)
106 | font("Helvetica Neue Bold")
107 | tracking(0)
108 | fill(1, 1, 1)
109 | stroke(None)
110 | text("Happy π Day", (-2, -32))
111 | fill(1, 0, 0)
112 | text(step_string, (-2, -64))
113 |
114 | step += 0.02 * math.pi
115 | step_string = "{:.8f}".format(fake_step)
116 | fake_step -= math.pi / 100
117 |
118 | saveImage("dbe_2016_03_14_v2.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_15_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/15/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math # for cos, sin and pi functions
14 |
15 | # static variables
16 | canvas = 512 # size of the gif in pixels
17 | num_frames = 100 # number of frames in the animation
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | grid_w = 256
22 | grid_h = 256
23 | center = grid_w / 2
24 | grid_x_units = 8
25 | grid_y_units = 8
26 |
27 | # circle variables
28 | circle_w = 256 #
29 | circle_h = 256 #
30 | circle_x = 0 #
31 | circle_y = 0 #
32 |
33 | # dot variables
34 | dot_size = 12
35 | dot_amp = 32
36 | amp_step = 0
37 | dot_step = 0.0
38 | dot_inc = 0.04
39 | dot_x = 0
40 | dot_y = 0
41 | divisions = 1
42 | step = 1
43 | amp = 1
44 | r = 1
45 | g = 1
46 | b = 0
47 |
48 | # draws a new frame in the animation
49 | def new_page():
50 | newPage(canvas, canvas) # new page from canvas variable
51 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
52 | fill(0.1) # color of background
53 | rect(0, 0, canvas, canvas) # draw the background
54 |
55 | # draws the dot from two position variables
56 | def dot(dot_x, dot_y, r, g, b):
57 | fill(r, g, b)
58 | stroke(None)
59 | oval(int(dot_x) + center, int(dot_y) + center, dot_size, dot_size)
60 |
61 | # draws a circle from 5 arguments, see 'gird variables' above
62 | def draw_circle(circle_w, circle_h, circle_x, circle_y,
63 | divisions, dot_amp, dot_step, dot_inc, r, g, b):
64 | # dot
65 | for segment in range(divisions):
66 |
67 | dot_x = math.cos(dot_step) * dot_amp
68 | dot_y = -1 * math.sin(dot_step) * dot_amp
69 | dot((dot_x)-dot_size/2, (dot_y)-dot_size/2, r, g, b)
70 | dot_step += dot_inc * math.pi
71 |
72 | # draws a grid from 5 arguments, see 'gird variables' above
73 | def draw_grid(origin, width, height, num_x_units, num_y_units):
74 | unit_y = (height / num_y_units)
75 | unit_x = (width / num_x_units)
76 | translate(*origin)
77 | strokeWidth(1)
78 | stroke(0.5)
79 | fill(None)
80 | step_x = 0
81 | step_y = 0
82 |
83 | for x in range(num_x_units + 1):
84 | line((step_x, 0), (step_x, height))
85 | step_x += unit_x
86 |
87 | for y in range(num_y_units + 1):
88 | line((0, step_y), (width, step_y))
89 | step_y += unit_y
90 |
91 | # draw each frame as a new page
92 | for frame in range(num_frames):
93 | new_page()
94 |
95 | draw_grid(origin, grid_w, grid_h, grid_x_units, grid_y_units)
96 |
97 | r = 1
98 | g = 0
99 | b = 0
100 | dot_amp = 32 + amp_step
101 | dot_inc = 0.25
102 | draw_circle(circle_w, circle_h, circle_x, circle_y,
103 | divisions, dot_amp, dot_step, dot_inc, r, g, b)
104 |
105 | r = 1
106 | g = 0.5
107 | b = 0
108 | dot_amp = 64 + amp_step
109 | dot_inc = 0.125
110 | draw_circle(circle_w, circle_h, circle_x, circle_y,
111 | divisions, dot_amp, dot_step, dot_inc, r, g, b)
112 |
113 | r = 1
114 | g = 1
115 | b = 0
116 | dot_amp = 96 + amp_step
117 | dot_inc = 0.0625
118 | draw_circle(circle_w, circle_h, circle_x, circle_y,
119 | divisions, dot_amp, dot_step, dot_inc, r, g, b)
120 |
121 | amp_step += 1
122 | divisions += 1
123 |
124 | saveImage("dbe_2016_03_15_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_16_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/16/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 |
15 | # static variables
16 | canvas = 512
17 | num_frames = 76
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 7
25 | num_y_units = 7
26 |
27 | # circle variables
28 | circle_w = 256 - 32
29 | circle_h = 256 - 32
30 | circle_x = 0
31 | circle_y = 0
32 | divisions = 0
33 |
34 | # box variables
35 | box_size_x = 36 * 2
36 | box_size_y = 36
37 | box_amp = 110
38 | box_step = 0
39 | box_inc = 16
40 | x_pos = 0
41 | y_pos = 0
42 | box_color = 1
43 | box_count = 100
44 | box_start = 0
45 | box_start_step = 0
46 |
47 | # draws a new frame in the animation
48 | def new_page():
49 | newPage(canvas, canvas)
50 | frameDuration(1/20)
51 | fill(0.8)
52 | rect(0, 0, canvas, canvas)
53 |
54 | # draws the dot from two position variables
55 | def box(x_pos, y_pos, box_size_x, box_size_y, box_color):
56 | fill((x_pos * 0.02) + 1, (y_pos * -0.01) + 1, 0.5)
57 | strokeWidth(1)
58 | stroke(0.1)
59 | rect(int(x_pos) + center, int(y_pos) + center,
60 | box_size_x, box_size_y)
61 |
62 | # draws a circle from 5 arguments, see 'gird variables' above
63 | def draw_circle(circle_w, circle_h, circle_x, circle_y,
64 | box_count, dot_amp, box_step, dot_inc, box_start):
65 |
66 | for segment in range(box_count):
67 | box_x = math.cos(box_step + box_start) * (box_amp - 16)
68 | box_y = -1 * math.sin(box_step + box_start) * box_amp
69 | box((box_x)-box_size_x/2, (box_y)-box_size_y/2,
70 | box_size_x, box_size_y, box_color)
71 |
72 | box_step += 0.02 * math.pi
73 |
74 | # draws a grid from given arguments
75 | def grid(origin, width, height, num_x_units, num_y_units):
76 | translate(*origin)
77 | strokeWidth(2)
78 | stroke(1)
79 | fill(None)
80 |
81 | step_x = 0
82 | unit_x = width / num_x_units
83 | for x in range(num_x_units + 1):
84 | line((step_x, 0), (step_x, height))
85 | step_x += unit_x
86 |
87 | step_y = 0
88 | unit_y = height / num_y_units
89 | for y in range(num_y_units + 1):
90 | line((0, step_y), (width, step_y))
91 | step_y += unit_y
92 |
93 | # draw each frame as a new page
94 | for frame in range(num_frames):
95 | new_page()
96 | grid(origin, width, height, num_x_units, num_y_units)
97 | draw_circle(circle_w, circle_h, circle_x, circle_y,
98 | box_count, box_amp, box_step, box_inc, box_start)
99 | box_count_string = "{:03d}".format(box_count)
100 | box_count += 1
101 | box_start += 0.02
102 |
103 | saveImage("dbe_2016_03_16_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_17_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/16/17 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | #from itertools import cycle, chain, repeat
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 63
19 |
20 | # gird variables
21 | origin = (128, 128)
22 | width = 256
23 | height = 256
24 | center = width/2
25 | num_x_units = 7
26 | num_y_units = 7
27 |
28 | # path variables
29 | path_x = 0
30 | path_y = 0
31 | divisions = 0
32 |
33 | # box variables
34 | box_size_x = 36
35 | box_size_y = 36
36 | box_amp = 74
37 | box_step = 0
38 | box_count = 51
39 | box_rt = 0
40 |
41 | def new_page():
42 | newPage(canvas, canvas)
43 | frameDuration(1/24)
44 | fill(0.8)
45 | rect(0, 0, canvas, canvas)
46 |
47 | def box(x_pos, y_pos, box_size_x, box_size_y, box_rt):
48 | fill(1)
49 | strokeWidth(1)
50 | stroke(0.3)
51 | rotate(box_rt)
52 | rect((x_pos - 2) + center, (y_pos - 2) + center, box_size_x, box_size_y)
53 |
54 | def draw_path(path_x, path_y, box_count, dot_amp, box_step, box_rt):
55 |
56 | for segment in range(box_count):
57 | box_x = math.cos(box_step) * box_amp
58 | box_y = math.sin(box_step) * box_amp
59 | box(box_x, box_y, box_size_x, box_size_y, box_rt)
60 |
61 | box_step += 0.01 * math.pi
62 |
63 | def grid(origin, width, height, num_x_units, num_y_units):
64 | translate(*origin)
65 | strokeWidth(1)
66 | stroke(0.3)
67 | fill(None)
68 |
69 | step_x = 0
70 | unit_x = width / num_x_units
71 | for x in range(num_x_units + 1):
72 | line((step_x, 0), (step_x, height))
73 | step_x += unit_x
74 |
75 | step_y = 0
76 | unit_y = height / num_y_units
77 | for y in range(num_y_units + 1):
78 | line((0, step_y), (width, step_y))
79 | step_y += unit_y
80 |
81 | for frame in range(num_frames):
82 | new_page()
83 | grid(origin, width, height, num_x_units, num_y_units)
84 | translate(-16, -16)
85 | draw_path(path_x, path_y, box_count, box_amp, box_step, box_rt)
86 | box_count_string = "{:03d}".format(box_count)
87 | box_step += 0.1
88 |
89 | saveImage("dbe_2016_03_17_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_18_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/18/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 |
15 | # static variables
16 | canvas = 512
17 | num_frames = 63
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # path variables
28 | path_x = 0
29 | path_y = 0
30 | divisions = 0
31 |
32 | # box variables
33 | box_size_x = 32
34 | box_size_y = 32
35 | box_amp = 24
36 | box_step = 0
37 | box_count = 100
38 | box_rt = 2
39 |
40 | def new_page():
41 | newPage(canvas, canvas)
42 | frameDuration(1/24)
43 | fill(0.8)
44 | rect(0, 0, canvas, canvas)
45 |
46 | def box(x_pos, y_pos, box_size_x, box_size_y):
47 | fill(1)
48 | strokeWidth(1)
49 | stroke(0.1)
50 | rotate(6)
51 | rect((x_pos - 2) + center/2, (y_pos - 2) + center/2,
52 | box_size_x, box_size_y)
53 |
54 | def draw_path(path_x, path_y, box_count, dot_amp, box_step):
55 | for segment in range(box_count):
56 | box_x = math.cos(box_step) * box_amp
57 | box_y = math.sin(box_step) * box_amp
58 | box(box_x, box_y, box_size_x, box_size_y)
59 | box_step += 0.1 * math.pi
60 |
61 | def grid(origin, width, height, num_x_units, num_y_units):
62 | translate(*origin)
63 | strokeWidth(1)
64 | stroke(0.5)
65 | fill(None)
66 |
67 | step_x = 0
68 | unit_x = width / num_x_units
69 | for x in range(num_x_units + 1):
70 | line((step_x, 0), (step_x, height))
71 | step_x += unit_x
72 |
73 | step_y = 0
74 | unit_y = height / num_y_units
75 | for y in range(num_y_units + 1):
76 | line((0, step_y), (width, step_y))
77 | step_y += unit_y
78 |
79 | for frame in range(num_frames):
80 | new_page()
81 | grid(origin, width, height, num_x_units, num_y_units)
82 | translate(128, 128)
83 | draw_path(path_x, path_y, box_count, box_amp, box_step)
84 | box_step += 0.1
85 |
86 | saveImage("dbe_2016_03_18_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_19_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/19/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | #from itertools import cycle, chain, repeat
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 63
19 |
20 | # gird variables
21 | origin = (128, 128)
22 | width = 256
23 | height = 256
24 | center = width/2
25 | num_x_units = 8
26 | num_y_units = 8
27 |
28 | # path variables
29 | path_x = 0
30 | path_y = 0
31 | divisions = 0
32 |
33 | # box variables
34 | dot_size_x = 20
35 | dot_size_y = 20
36 | dot_amp = 120
37 | dot_step = 0
38 | dot_count = 100
39 |
40 | def new_page():
41 | newPage(canvas, canvas)
42 | frameDuration(1/24)
43 | fill(0.025, 0.025, 0.1)
44 | rect(0, 0, canvas, canvas)
45 |
46 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
47 | stroke(None)
48 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
49 |
50 | def draw_path(path_x, path_y, dot_count, dot_amp, dot_step, fill):
51 | for segment in range(dot_count):
52 | dot_x = math.cos(dot_step) * dot_amp
53 | dot_y = math.sin(dot_step) * dot_amp
54 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
55 | dot_step += 0.01 * math.pi
56 |
57 | def grid(origin, width, height, num_x_units, num_y_units):
58 | translate(*origin)
59 | strokeWidth(1)
60 | stroke(0.025, 0.025, 0.1)
61 | fill(None)
62 |
63 | step_x = 0
64 | unit_x = width / num_x_units
65 | for x in range(num_x_units + 1):
66 | line((step_x, 0), (step_x, height))
67 | step_x += unit_x
68 |
69 | step_y = 0
70 | unit_y = height / num_y_units
71 | for y in range(num_y_units + 1):
72 | line((0, step_y), (width, step_y))
73 | step_y += unit_y
74 |
75 | for frame in range(num_frames):
76 | new_page()
77 | grid(origin, width, height, num_x_units, num_y_units)
78 | fill(0.9, 0, 0.1)
79 | draw_path(path_x, path_y, dot_count, dot_amp, dot_step, fill)
80 | fill(0.9, 0.25, 0.1)
81 | draw_path(path_x, path_y, dot_count, dot_amp-24, dot_step-24, fill)
82 | fill(0.9, 0.4, 0.1)
83 | draw_path(path_x, path_y, dot_count, dot_amp-48, dot_step-48, fill)
84 | fill(0.9, 0.6, 0.1)
85 | draw_path(path_x, path_y, dot_count, dot_amp-72, dot_step-72, fill)
86 | fill(0.9, 0.8, 0.1)
87 | draw_path(path_x, path_y, dot_count, dot_amp-96, dot_step-96, fill)
88 | fill(0.9, 1, 0.5)
89 | stroke(None)
90 | oval(center-10, center-10, dot_size_x, dot_size_y)
91 | dot_step += 0.1
92 |
93 | saveImage("dbe_2016_03_19_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_20_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/20/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | import itertools
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 126
19 |
20 | # gird variables
21 | origin = (128, 128)
22 | width = 256
23 | height = 256
24 | center = width/2
25 | num_x_units = 8
26 | num_y_units = 8
27 |
28 | # path variables
29 | path_x = 0
30 | path_y = 0
31 | divisions = 0
32 |
33 | # box variables
34 | dot_size_x = 20
35 | dot_size_y = 20
36 | dot_amp = 120
37 | dot_step = 0
38 | dot_count = 1
39 | dot_shift = 0
40 |
41 | #itertools
42 | seq_up = range(4, 256, 4)
43 | seq_dn = range(256, 4, -4)
44 | seq = seq_up + seq_dn
45 | print seq
46 | seq_step = itertools.cycle(seq)
47 |
48 | def new_page():
49 | newPage(canvas, canvas)
50 | frameDuration(1/24)
51 | fill(0.025, 0.025, 0.1)
52 | rect(0, 0, canvas, canvas)
53 |
54 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
55 | stroke(None)
56 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
57 |
58 | def draw_path(path_x, path_y, dot_count, dot_amp, dot_step, fill):
59 | for segment in range(dot_count):
60 | dot_x = math.cos(dot_step) * dot_amp
61 | dot_y = math.sin(dot_step) * dot_amp
62 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
63 | dot_step += 0.01 * math.pi
64 |
65 | def grid(origin, width, height, num_x_units, num_y_units):
66 | translate(*origin)
67 | strokeWidth(1)
68 | stroke(0.025, 0.025, 0.1)
69 | fill(None)
70 |
71 | step_x = 0
72 | unit_x = width / num_x_units
73 | for x in range(num_x_units + 1):
74 | line((step_x, 0), (step_x, height))
75 | step_x += unit_x
76 |
77 | step_y = 0
78 | unit_y = height / num_y_units
79 | for y in range(num_y_units + 1):
80 | line((0, step_y), (width, step_y))
81 | step_y += unit_y
82 |
83 | for frame in range(num_frames):
84 | new_page()
85 | grid(origin, width, height, num_x_units, num_y_units)
86 | fill(0.9, 0, 0.1)
87 | draw_path(path_x, path_y, dot_count, dot_amp, dot_step+dot_shift*6, fill)
88 | fill(0.9, 0.25, 0.1)
89 | draw_path(path_x, path_y, dot_count, dot_amp-24, dot_step+dot_shift*5, fill)
90 | fill(0.9, 0.4, 0.1)
91 | draw_path(path_x, path_y, dot_count, dot_amp-48, dot_step+dot_shift*4, fill)
92 | fill(0.9, 0.6, 0.1)
93 | draw_path(path_x, path_y, dot_count, dot_amp-72, dot_step+dot_shift*3, fill)
94 | fill(0.9, 0.8, 0.1)
95 | draw_path(path_x, path_y, dot_count, dot_amp-96, dot_step+dot_shift*2, fill)
96 | fill(0.9, 0.9, 0.3)
97 | stroke(None)
98 | oval(center-10, center-10, dot_size_x, dot_size_y)
99 | dot_step += 0.1
100 | dot_shift += 0.1
101 | dot_count = seq_step.next()
102 | dot_count_string = "{:.1f}".format(dot_count)
103 |
104 | # type
105 | # fontSize(24)
106 | # font("Helvetica Neue Bold")
107 | # fill(1, 1, 1)
108 | # stroke(None)
109 | # text("Dot Count:", (-2, -32))
110 | # fill(1, 0, 0)
111 | # text(dot_count_string, (-2, -64))
112 |
113 | saveImage("dbe_2016_03_20_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_21_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/21/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import itertools
14 |
15 | # static variables
16 | canvas = 512
17 | num_frames = 32
18 |
19 | # gird variables
20 | origin = (128, 128)
21 | width = 256
22 | height = 256
23 | center = width/2
24 | num_x_units = 8
25 | num_y_units = 8
26 |
27 | # dox variables
28 | dot_size_x = 32
29 | dot_size_y = 32
30 | dot_x = 0
31 | dot_y = 0
32 | dot_amp = 1.5 # adjusts how high the ball bounces, try 0.5, 1, 4, etc...
33 |
34 | #itertools
35 | seq_up = [5, 25, 50, 70, 90, 100, 110, 116, 122, 126, 130, 132, 134, 135, 136, 136]
36 | seq_dn = [136, 135, 134, 132, 130, 126, 122, 116, 110, 100, 90, 70, 50, 20, 0, 0]
37 |
38 | seq_x_up_size = [28, 30, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32]
39 | seq_x_dn_size = [32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 30, 46]
40 |
41 | seq_y_up_size = [44, 44, 42, 40, 38, 36, 34, 33, 32, 32, 32, 32, 32, 32, 32, 32]
42 | seq_y_dn_size = [32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 34, 40, 28]
43 |
44 | seq = seq_up + seq_dn
45 | seq_x_size = seq_x_up_size + seq_x_dn_size
46 | seq_y_size = seq_y_up_size + seq_y_dn_size
47 |
48 | print seq
49 | print seq_x_size
50 | print seq_y_size
51 | print len(seq_x_size)
52 | print len(seq_y_size)
53 | print len(seq)
54 |
55 | seq_step = itertools.cycle(seq)
56 | seq_x_size_step = itertools.cycle(seq_x_size)
57 | seq_y_size_step = itertools.cycle(seq_y_size)
58 |
59 | def new_page():
60 | newPage(canvas, canvas)
61 | frameDuration(1/24)
62 | fill(0.05, 0.05, 0.05)
63 | rect(0, 0, canvas, canvas)
64 |
65 | def grid(origin, width, height, num_x_units, num_y_units):
66 | translate(*origin)
67 | strokeWidth(1)
68 | stroke(0.9, 0.9, 0.9)
69 | fill(None)
70 |
71 | step_x = 0
72 | unit_x = width / num_x_units
73 | for x in range(num_x_units + 1):
74 | line((step_x, 0), (step_x, height))
75 | step_x += unit_x
76 |
77 | step_y = 0
78 | unit_y = height / num_y_units
79 | for y in range(num_y_units + 1):
80 | line((0, step_y), (width, step_y))
81 | step_y += unit_y
82 |
83 | for frame in range(num_frames):
84 | new_page()
85 | grid(origin, width, height, num_x_units, num_y_units)
86 | fill(0.9, 0, 0)
87 | stroke(None)
88 |
89 | dot_size_x = seq_x_size_step.next()
90 | dot_size_y = seq_y_size_step.next()
91 | dot_y = seq_step.next()
92 | oval((dot_x - dot_size_x/2) + center, ((dot_y * dot_amp) - 128) + center,
93 | dot_size_x, dot_size_y)
94 |
95 | # type
96 | dot_size_y_string = "{:03d}".format(dot_size_y)
97 | dot_size_x_string = "{:03d}".format(dot_size_x)
98 | dot_y_string = "{:03d}".format(int(dot_y * dot_amp))
99 | fontSize(18)
100 | font("input mono")
101 | fill(0.9, 0.9, 0.9)
102 | stroke(None)
103 | text("y_position:", (-1, -24))
104 | text("squash:", (-1, -24*2))
105 | text("stretch:", (-1, -24*3))
106 | fill(0.9, 0, 0)
107 | text(dot_y_string, (224, -24))
108 | text(dot_size_x_string, (224, -24*2))
109 | text(dot_size_y_string, (224, -24*3))
110 |
111 | saveImage("dbe_2016_03_21_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_22_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/22/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | import itertools
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 58
19 |
20 | # gird variables
21 | origin = (32, 32)
22 | width = 448 - 128
23 | height = 448
24 | center = width/2
25 | num_x_units = 10
26 | num_y_units = 14
27 |
28 | #type
29 | type_x_pos = 0
30 | type_y_pos = 0
31 | type_step = 0
32 | hw_rt = 0
33 | hw_fs = 36 * 2
34 | hw_x_pos = 0
35 | hw_y_pos = 0
36 | hw_t = 0
37 | #itertools
38 | type_rt_list = [0, 0, 0, 0, 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, 0, 0, 0, 0, 0]
39 | print len(type_rt_list)
40 |
41 | type_rt_step = itertools.cycle(type_rt_list)
42 |
43 | def new_page():
44 | newPage(canvas, canvas)
45 | frameDuration(1/24)
46 | fill(0.8)
47 | rect(0, 0, canvas, canvas)
48 |
49 | def hello_world(hw_x_pos, hw_y_pos, hw_rt, hw_fs, hw_t):
50 | fill(0)
51 | hw_rt = type_rt_step.next()
52 | fontSize(64)
53 | rotate(hw_rt)
54 | tracking(-2.2)
55 | font("Helvetica neue Bold")
56 | text("Hello World", (-1, 0))
57 |
58 | def grid(origin, width, height, num_x_units, num_y_units):
59 | translate(96, 32)
60 | strokeWidth(1)
61 | stroke(0.5)
62 | fill(None)
63 |
64 | step_x = 0
65 | unit_x = width / num_x_units
66 | for x in range(num_x_units + 1):
67 | line((step_x, 0), (step_x, height))
68 | step_x += unit_x
69 |
70 | step_y = 0
71 | unit_y = height / num_y_units
72 | for y in range(num_y_units + 1):
73 | line((0, step_y), (width, step_y))
74 | step_y += unit_y
75 |
76 | for frame in range(num_frames):
77 | new_page()
78 | grid(origin, width, height, num_x_units, num_y_units)
79 | fill(1, 0, 0)
80 | stroke(None)
81 | #oval(32, 352, 32, 32)
82 | translate(-2, 0)
83 | hello_world(hw_x_pos, hw_y_pos, hw_rt, hw_fs, hw_t)
84 | hw_t += 4
85 |
86 | saveImage("dbe_2016_03_22_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_23_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # WWW: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/23/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | import itertools
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 58
19 |
20 | # gird variables
21 | origin = (32, 32)
22 | width = 448 - 128
23 | height = 448
24 | center = width/2
25 | num_x_units = 10
26 | num_y_units = 14
27 |
28 | #type
29 | type_x_pos = 0
30 | type_y_pos = 0
31 | type_step = 0
32 | hw_rt = 0
33 | hw_fs = 36 * 2
34 | hw_x_pos = 0
35 | hw_y_pos = 0
36 | hw_t = 0
37 | #itertools
38 | type_rt_list = [0, 0, 0, 0, 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, 0, 0, 0, 0, 0]
39 | print len(type_rt_list)
40 |
41 | type_rt_step = itertools.cycle(type_rt_list)
42 |
43 | def new_page():
44 | newPage(canvas, canvas)
45 | frameDuration(1/24)
46 | fill(0.8)
47 | rect(0, 0, canvas, canvas)
48 |
49 | def hello_world(hw_x_pos, hw_y_pos, hw_rt, hw_fs, hw_t):
50 | fill(0)
51 | hw_rt = type_rt_step.next()
52 | fontSize(64)
53 | rotate(hw_rt)
54 | tracking(-2.2)
55 | font("Helvetica neue Bold")
56 | text("Hello World", (-1, 0))
57 |
58 | def grid(origin, width, height, num_x_units, num_y_units):
59 | translate(96, 32)
60 | strokeWidth(1)
61 | stroke(0.5)
62 | fill(None)
63 |
64 | step_x = 0
65 | unit_x = width / num_x_units
66 | for x in range(num_x_units + 1):
67 | line((step_x, 0), (step_x, height))
68 | step_x += unit_x
69 |
70 | step_y = 0
71 | unit_y = height / num_y_units
72 | for y in range(num_y_units + 1):
73 | line((0, step_y), (width, step_y))
74 | step_y += unit_y
75 |
76 | for frame in range(num_frames):
77 | new_page()
78 | grid(origin, width, height, num_x_units, num_y_units)
79 | fill(1, 0, 0)
80 | stroke(None)
81 | #oval(32, 352, 32, 32)
82 | translate(-2, 0)
83 | hello_world(hw_x_pos, hw_y_pos, hw_rt, hw_fs, hw_t)
84 | hw_t += 4
85 |
86 | saveImage("dbe_2016_03_23_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_24_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/24/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | # from drawBot import * # uncomment if using setupAsModule.py
13 | import math
14 | import itertools
15 |
16 | # static variables
17 | canvas = 512
18 | num_frames = 60
19 |
20 | # gird variables
21 | origin = (128, 128)
22 | width = 256
23 | height = 256
24 | center = width/2
25 | num_x_units = 8
26 | num_y_units = 8
27 |
28 | # dot variables
29 | dot_size_x = 20
30 | dot_size_y = 20
31 | dot_amp = 120
32 | dot_step = 0
33 | dot_count = 1
34 | dot_shift = 0
35 |
36 | #itertools
37 | seq_up = range(4, 120, 4)
38 | seq_dn = range(120, 4, -4)
39 | seq = seq_up + seq_dn
40 | print seq
41 | seq_step = itertools.cycle(seq)
42 |
43 | def new_page():
44 | newPage(canvas, canvas)
45 | frameDuration(1/24)
46 | fill(0.1, 0.1, 0.2)
47 | rect(0, 0, canvas, canvas)
48 |
49 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
50 | stroke(None)
51 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
52 |
53 | def draw_path(dot_count, dot_amp, dot_step):
54 | for segment in range(dot_count):
55 | dot_x = math.cos(dot_step) * dot_amp
56 | dot_y = math.sin(dot_step) * dot_amp
57 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
58 | dot_step += 0.0083 * math.pi
59 |
60 | def grid(origin, width, height, num_x_units, num_y_units):
61 | translate(*origin)
62 | strokeWidth(1)
63 | stroke(0.5, 0.5, 0.7)
64 | fill(None)
65 |
66 | step_x = 0
67 | unit_x = width / num_x_units
68 | for x in range(num_x_units + 1):
69 | line((step_x, 0), (step_x, height))
70 | step_x += unit_x
71 |
72 | step_y = 0
73 | unit_y = height / num_y_units
74 | for y in range(num_y_units + 1):
75 | line((0, step_y), (width, step_y))
76 | step_y += unit_y
77 |
78 | for frame in range(num_frames):
79 | new_page()
80 | grid(origin, width, height, num_x_units, num_y_units)
81 |
82 | fill(0.9, 0.2, 0.1)
83 | draw_path(dot_count, dot_amp, dot_step+dot_shift)
84 |
85 | fill(0.9, 0.4, 0.1)
86 | draw_path(dot_count, dot_amp-24, dot_step+dot_shift+0.2)
87 |
88 | fill(0.9, 0.9, 0.1)
89 | draw_path(dot_count, dot_amp-48, dot_step+dot_shift+0.4)
90 |
91 | fill(0.2, 0.8, 0.1)
92 | draw_path(dot_count, dot_amp-72, dot_step+dot_shift+0.6)
93 |
94 | fill(0.1, 0.6, 0.9)
95 | draw_path(dot_count, dot_amp-96, dot_step+dot_shift+0.8)
96 |
97 | fill(0.1, 0.3, 0.9)
98 | oval(center-10, center-10, dot_size_x, dot_size_y)
99 |
100 | dot_step += 0.095
101 | dot_shift += 0.01
102 | dot_count = seq_step.next()
103 |
104 | saveImage("dbe_2016_03_24_v1.gif")
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_26_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/26/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | from drawBot import * # if using setupAsModule.py
13 | import math
14 | import itertools
15 | import random
16 |
17 |
18 |
19 | # static variables
20 | canvas = 512
21 | num_frames = 60
22 | angle_delta = 2*math.pi/num_frames
23 |
24 | # gird variables
25 | origin = (128, 128)
26 | width = 256
27 | height = 256
28 | center = width/2
29 | num_x_units = 8
30 | num_y_units = 8
31 |
32 | # dot variables
33 | dot_size_x = 20
34 | dot_size_y = 20
35 | dot_angle = 0
36 | dot_count = 1
37 | dot_shift = 0
38 | num_dots = 4
39 |
40 | #itertools
41 | seq_up = range(4, 120, 4)
42 | seq_dn = range(120, 4, -4)
43 | seq = seq_up + seq_dn
44 | print seq
45 | seq_step = itertools.cycle(seq)
46 |
47 | def new_page():
48 | newPage(canvas, canvas)
49 | frameDuration(1/24)
50 | fill(0.1, 0.1, 0.2)
51 | rect(0, 0, canvas, canvas)
52 |
53 | def dot(dot_x, dot_y, dot_size_x, dot_size_y):
54 | stroke(None)
55 | oval((dot_x-2)+center, (dot_y-2)+center, dot_size_x, dot_size_y)
56 |
57 | def draw_path(arc_start, arc_end, dot_rad):
58 | current_angle = arc_start_angle
59 | while current_angle <= arc_end_angle:
60 | dot()
61 | current_angle += delta
62 |
63 | for segment in range(dot_count):
64 | dot_x = math.cos(dot_angle) * dot_amp
65 | dot_y = math.sin(dot_angle) * dot_amp
66 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y)
67 | dot_angle += 0.0083 * math.pi
68 |
69 | def grid(origin, width, height, num_x_units, num_y_units):
70 | translate(*origin)
71 | strokeWidth(1)
72 | stroke(0.5, 0.5, 0.7)
73 | fill(None)
74 |
75 | step_x = 0
76 | unit_x = width / num_x_units
77 | for x in range(num_x_units + 1):
78 | line((step_x, 0), (step_x, height))
79 | step_x += unit_x
80 |
81 | step_y = 0
82 | unit_y = height / num_y_units
83 | for y in range(num_y_units + 1):
84 | line((0, step_y), (width, step_y))
85 | step_y += unit_y
86 |
87 | for frame in range(num_frames):
88 | new_page()
89 | grid(origin, width, height, num_x_units, num_y_units)
90 |
91 | for d in range(num_dots):
92 |
93 | r = random.random()
94 | g = random.random()
95 | b = random.random()
96 | fill(r, g, b)
97 |
98 | amp = d*24
99 | draw_path(dot_count, amp, dot_angle)
100 |
101 | dot_angle += angle_delta
102 | dot_count = seq_step.next()
103 |
104 | saveImage("dbe_2016_03_26_v1.pdf")
105 |
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_27_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/26/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | from drawBot import * # if using setupAsModule.py
13 | import math
14 | import itertools
15 | import random
16 |
17 |
18 |
19 | # static variables
20 | canvas = 512
21 | num_frames = 60
22 | angle_delta = 2*math.pi/num_frames
23 |
24 | # gird variables
25 | origin = (128, 128)
26 | width = 256
27 | height = 256
28 | center = width/2
29 | num_x_units = 8
30 | num_y_units = 8
31 |
32 | # dot variables
33 | dot_size_x = 20
34 | dot_size_y = 20
35 | dot_angle = 0
36 | dot_count = 1
37 | dot_shift = 0
38 | num_dots = 4
39 |
40 | #itertools
41 | seq_up = range(4, 120, 4)
42 | seq_dn = range(120, 4, -4)
43 | seq = seq_up + seq_dn
44 | print seq
45 | seq_step = itertools.cycle(seq)
46 |
47 | def new_page():
48 | newPage(canvas, canvas)
49 | frameDuration(1/24)
50 | fill(0.1, 0.1, 0.2)
51 | rect(0, 0, canvas, canvas)
52 |
53 | def dot(dot_x, dot_y, dot_size_x, dot_size_y):
54 | stroke(None)
55 | oval((dot_x-2)+center, (dot_y-2)+center, dot_size_x, dot_size_y)
56 |
57 | def draw_path(arc_start, arc_end, dot_rad):
58 | current_angle = arc_start_angle
59 | while current_angle <= arc_end_angle:
60 | dot()
61 | current_angle += delta
62 |
63 | for segment in range(dot_count):
64 | dot_x = math.cos(dot_angle) * dot_amp
65 | dot_y = math.sin(dot_angle) * dot_amp
66 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y)
67 | dot_angle += 0.0083 * math.pi
68 |
69 | def grid(origin, width, height, num_x_units, num_y_units):
70 | translate(*origin)
71 | strokeWidth(1)
72 | stroke(0.5, 0.5, 0.7)
73 | fill(None)
74 |
75 | step_x = 0
76 | unit_x = width / num_x_units
77 | for x in range(num_x_units + 1):
78 | line((step_x, 0), (step_x, height))
79 | step_x += unit_x
80 |
81 | step_y = 0
82 | unit_y = height / num_y_units
83 | for y in range(num_y_units + 1):
84 | line((0, step_y), (width, step_y))
85 | step_y += unit_y
86 |
87 | for frame in range(num_frames):
88 | new_page()
89 | grid(origin, width, height, num_x_units, num_y_units)
90 |
91 | for d in range(num_dots):
92 |
93 | r = random.random()
94 | g = random.random()
95 | b = random.random()
96 | fill(r, g, b)
97 |
98 | amp = d*24
99 | draw_path(dot_count, amp, dot_angle)
100 |
101 | dot_angle += angle_delta
102 | dot_count = seq_step.next()
103 |
104 | saveImage("dbe_2016_03_26_v1.pdf")
105 |
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_28_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: http://drawbot-exercises.tumblr.com/ #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/28/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | from drawBot import * # if using setupAsModule.py
13 | import math
14 | import itertools
15 | import random
16 |
17 | # static variables
18 | canvas = 512
19 | num_frames = 60
20 | angle_delta = 2*math.pi/num_frames
21 |
22 | # gird variables
23 | origin = (128, 128)
24 | width = 256
25 | height = 256
26 | center = width/2
27 | num_x_units = 8
28 | num_y_units = 8
29 |
30 | # dot variables
31 | dot_size_x = 20
32 | dot_size_y = 20
33 | dot_angle = 0
34 | dot_count = 1
35 | dot_shift = 0
36 | num_dots = 4
37 |
38 | def new_page():
39 | newPage(canvas, canvas)
40 | frameDuration(1/24)
41 | fill(0.1, 0.1, 0.2)
42 | rect(0, 0, canvas, canvas)
43 |
44 | def dot(dot_x, dot_y, dot_size_x, dot_size_y):
45 | stroke(None)
46 | oval((dot_x-2)+center, (dot_y-2)+center,
47 | dot_size_x, dot_size_y)
48 |
49 | def draw_path(arc_start, arc_end, dot_radius):
50 | current_angle = arc_start_angle
51 | while current_angle <= arc_end_angle:
52 | dot()
53 | current_angle += delta
54 |
55 | for segment in range(dot_count):
56 | dot_x = math.cos(dot_angle) * dot_amp
57 | dot_y = math.sin(dot_angle) * dot_amp
58 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y)
59 | dot_angle += 0.0083 * math.pi
60 |
61 | def grid(origin, width, height, num_x_units, num_y_units):
62 | translate(*origin)
63 | strokeWidth(1)
64 | stroke(0.5, 0.5, 0.7)
65 | fill(None)
66 |
67 | step_x = 0
68 | unit_x = width / num_x_units
69 | for x in range(num_x_units + 1):
70 | line((step_x, 0), (step_x, height))
71 | step_x += unit_x
72 |
73 | step_y = 0
74 | unit_y = height / num_y_units
75 | for y in range(num_y_units + 1):
76 | line((0, step_y), (width, step_y))
77 | step_y += unit_y
78 |
79 | for frame in range(num_frames):
80 | new_page()
81 | grid(origin, width, height, num_x_units, num_y_units)
82 |
83 | for d in range(num_dots):
84 |
85 | r = random.random()
86 | g = random.random()
87 | b = random.random()
88 | fill(r, g, b)
89 |
90 | dot_radius = d*24
91 | draw_path(dot_start, dot_end, dot_radius)
92 | dot_start = 45 + d
93 | dot_end = 90 + d
94 |
95 | dot_angle += angle_delta
96 |
97 | saveImage("dbe_2016_03_28_v1.pdf")
98 |
--------------------------------------------------------------------------------
/2016_03/dbe_2016_03_29_v1.py:
--------------------------------------------------------------------------------
1 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
2 | # #
3 | # Eli Heuer's daily DrawBot exercise! #
4 | # #
5 | # Web: https://www.tumblr.com/blog/drawbot-exercises #
6 | # Mail: eliheuer@gmail.com #
7 | # Drawn on: 03/29/16 -- version 1 #
8 | # Made with DrawBot: http://www.drawbot.com/ #
9 | # #
10 | #/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
11 |
12 | from drawBot import * # if using setupAsModule.py
13 | import math
14 | import itertools
15 | import random
16 |
17 | # static variables
18 | canvas = 512
19 | num_frames = 60
20 | angle_delta = 2*math.pi/num_frames
21 |
22 | # gird variables
23 | origin = (128, 128)
24 | width = 256
25 | height = 256
26 | center = width/2
27 | num_x_units = 8
28 | num_y_units = 8
29 |
30 | # dot variables
31 | dot_size_x = 20
32 | dot_size_y = 20
33 | dot_angle = 0
34 | dot_count = 1
35 | dot_shift = 0
36 | num_dots = 4
37 |
38 | #itertools
39 | seq_up = range(4, 120, 4)
40 | seq_dn = range(120, 4, -4)
41 | seq = seq_up + seq_dn
42 | print seq
43 | seq_step = itertools.cycle(seq)
44 |
45 | def new_page():
46 | newPage(canvas, canvas)
47 | frameDuration(1/24)
48 | fill(0.1, 0.1, 0.2)
49 | rect(0, 0, canvas, canvas)
50 |
51 | def dot(dot_x, dot_y, dot_size_x, dot_size_y):
52 | stroke(None)
53 | oval((dot_x-2)+center, (dot_y-2)+center, dot_size_x, dot_size_y)
54 |
55 | def draw_path(arc_start, arc_end, dot_rad):
56 | current_angle = arc_start_angle
57 | while current_angle <= arc_end_angle:
58 | dot()
59 | current_angle += delta
60 |
61 | for segment in range(dot_count):
62 | dot_x = math.cos(dot_angle) * dot_amp
63 | dot_y = math.sin(dot_angle) * dot_amp
64 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y)
65 | dot_angle += 0.0083 * math.pi
66 |
67 | def grid(origin, width, height, num_x_units, num_y_units):
68 | translate(*origin)
69 | strokeWidth(1)
70 | stroke(0.5, 0.5, 0.7)
71 | fill(None)
72 |
73 | step_x = 0
74 | unit_x = width / num_x_units
75 | for x in range(num_x_units + 1):
76 | line((step_x, 0), (step_x, height))
77 | step_x += unit_x
78 |
79 | step_y = 0
80 | unit_y = height / num_y_units
81 | for y in range(num_y_units + 1):
82 | line((0, step_y), (width, step_y))
83 | step_y += unit_y
84 |
85 | for frame in range(num_frames):
86 | new_page()
87 | grid(origin, width, height, num_x_units, num_y_units)
88 |
89 | for d in range(num_dots):
90 |
91 | r = random.random()
92 | g = random.random()
93 | b = random.random()
94 | fill(r, g, b)
95 |
96 | amp = d*24
97 | draw_path(dot_count, amp, dot_angle)
98 |
99 | dot_angle += angle_delta
100 | dot_count = seq_step.next()
101 |
102 | saveImage("dbe_2016_03_29_v1.pdf")
103 |
--------------------------------------------------------------------------------
/2016_03/notes.py:
--------------------------------------------------------------------------------
1 | my_list = []
2 | x = 0
3 | y = 16
4 | a = 0
5 |
6 | for i in range(16):
7 | a = x + y
8 | my_list.append(a)
9 | x = a
10 | y -= 1
11 |
12 | print my_list
--------------------------------------------------------------------------------
/2016_09/dbe_2016_09_10.py:
--------------------------------------------------------------------------------
1 | # first try at a drawbot twitch stream
2 | import math
3 |
4 | # static variables
5 | canvas = 256
6 | num_frames = 63
7 | center = 128
8 |
9 | # path variables
10 | path_x = 0
11 | path_y = 0
12 |
13 | # box variables
14 | box_size_x = 24
15 | box_size_y = 24
16 | box_amp = 32
17 | box_step = 0
18 | box_count = 32
19 |
20 | def new_page():
21 | newPage(canvas, canvas)
22 | frameDuration(1/24)
23 | def box(x_pos, y_pos, box_size_x, box_size_y):
24 | fill(0.95)
25 | strokeWidth(0.5)
26 | stroke(0.3)
27 | rotate(6)
28 | rect((x_pos - 2) + center/4, (y_pos - 2) + center/4,
29 | box_size_x, box_size_y)
30 |
31 | def draw_path(path_x, path_y, box_count, box_amp, box_step):
32 | for segment in range(box_count):
33 | box_x = math.cos(box_step) * box_amp/2
34 | box_y = math.sin(box_step) * box_amp/2
35 | box(box_x, box_y, box_size_x, box_size_y)
36 | box_step += 0.05 * math.pi
37 |
38 | for frame in range(num_frames):
39 | new_page()
40 | translate(128, 128)
41 | draw_path(path_x, path_y, box_count, box_amp, box_step)
42 | box_step += 0.1
43 |
44 | saveImage("twitch.gif")
--------------------------------------------------------------------------------
/2017-01/2017-jan-05.py:
--------------------------------------------------------------------------------
1 | # GIF file rendered with DrawBot: http://www.drawbot.com/
2 |
3 | import math
4 | import itertools
5 |
6 | # static variables
7 | canvas = 512
8 | num_frames = 60
9 |
10 | # gird variables
11 | origin = (128, 128)
12 | width = 256
13 | height = 256
14 | center = width/2
15 | num_x_units = 8
16 | num_y_units = 8
17 |
18 | # dot variables
19 | dot_size_x = 20
20 | dot_size_y = 20
21 | dot_amp = 120
22 | dot_step = 0
23 | dot_count = 1
24 | dot_shift = 0
25 |
26 | #itertools
27 | seq_up = range(4, 120, 4)
28 | seq_dn = range(120, 4, -4)
29 | seq = seq_up + seq_dn
30 | print seq
31 | seq_step = itertools.cycle(seq)
32 |
33 | def new_page():
34 | newPage(canvas, canvas)
35 | frameDuration(1/24)
36 | fill(0.1)
37 | rect(0, 0, canvas, canvas)
38 |
39 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
40 | stroke(None)
41 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
42 |
43 | def draw_path(dot_count, dot_amp, dot_step):
44 | for segment in range(dot_count):
45 | dot_x = math.cos(dot_step) * dot_amp
46 | dot_y = math.sin(dot_step) * dot_amp
47 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
48 | dot_step += 0.01 * math.pi
49 |
50 | def grid(origin, width, height, num_x_units, num_y_units):
51 | translate(*origin)
52 | strokeWidth(1)
53 | stroke(0.2)
54 | fill(None)
55 |
56 | step_x = 0
57 | unit_x = width / num_x_units
58 | for x in range(num_x_units + 1):
59 | line((step_x, 0), (step_x, height))
60 | step_x += unit_x
61 |
62 | step_y = 0
63 | unit_y = height / num_y_units
64 | for y in range(num_y_units + 1):
65 | line((0, step_y), (width, step_y))
66 | step_y += unit_y
67 |
68 | for frame in range(num_frames):
69 | new_page()
70 | grid(origin, width, height, num_x_units, num_y_units)
71 |
72 | fill(0.9, 0.2, 0.1)
73 | draw_path(dot_count, dot_amp, dot_step+dot_shift)
74 |
75 | fill(0.9, 0.4, 0.1)
76 | draw_path(dot_count, dot_amp-24, dot_step+dot_shift+0.2)
77 |
78 | fill(0.9, 0.9, 0.1)
79 | draw_path(dot_count, dot_amp-48, dot_step+dot_shift+0.4)
80 |
81 | fill(0.2, 0.8, 0.1)
82 | draw_path(dot_count, dot_amp-72, dot_step+dot_shift+0.6)
83 |
84 | fill(0.1, 0.6, 0.9)
85 | draw_path(dot_count, dot_amp-96, dot_step+dot_shift+0.8)
86 |
87 | fill(0.1, 0.3, 0.9)
88 | oval(center-10, center-10, dot_size_x, dot_size_y)
89 |
90 | dot_step += 0.095
91 | dot_shift += 0.01
92 | dot_count = seq_step.next()
93 |
94 | saveImage("2017-jan-05.gif")
95 |
--------------------------------------------------------------------------------
/2017-01/2017-jan-06.py:
--------------------------------------------------------------------------------
1 | # GIF file rendered with DrawBot: http://www.drawbot.com/
2 |
3 | import math
4 | import itertools
5 |
6 | # static variables
7 | canvas = 512
8 | num_frames = 60
9 |
10 | # gird variables
11 | origin = (128, 128)
12 | width = 256
13 | height = 256
14 | center = width/2
15 | num_x_units = 16
16 | num_y_units = 16
17 |
18 | # dot variables
19 | dot_size_x = 20
20 | dot_size_y = 20
21 | dot_amp = 120
22 | dot_step = 0
23 | dot_count = 1
24 | dot_shift = 0
25 |
26 | #itertools
27 | seq_up = range(2, 60, 2)
28 | seq_dn = range(60, 2, -2)
29 | seq = seq_up + seq_dn
30 | print seq
31 | seq_step = itertools.cycle(seq)
32 |
33 | def new_page():
34 | newPage(canvas, canvas)
35 | frameDuration(1/24)
36 | fill(0.1)
37 | rect(0, 0, canvas, canvas)
38 |
39 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
40 | stroke(None)
41 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
42 |
43 | def draw_path(dot_count, dot_amp, dot_step):
44 | for segment in range(dot_count):
45 | dot_x = math.cos(dot_step) * dot_amp
46 | dot_y = math.sin(dot_step) * dot_amp
47 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
48 | dot_step += 0.012 * math.pi
49 |
50 | def draw_path_rev(dot_count, dot_amp, dot_step):
51 | for segment in range(dot_count):
52 | dot_x = math.cos(dot_step) * dot_amp
53 | dot_y = math.sin(dot_step) * dot_amp
54 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
55 | dot_step -= 0.012 * math.pi
56 |
57 | def grid(origin, width, height, num_x_units, num_y_units):
58 | translate(*origin)
59 | strokeWidth(1)
60 | stroke(0.2)
61 | fill(None)
62 |
63 | step_x = 0
64 | unit_x = width / num_x_units
65 | for x in range(num_x_units + 1):
66 | line((step_x, 0), (step_x, height))
67 | step_x += unit_x
68 |
69 | step_y = 0
70 | unit_y = height / num_y_units
71 | for y in range(num_y_units + 1):
72 | line((0, step_y), (width, step_y))
73 | step_y += unit_y
74 |
75 | for frame in range(num_frames):
76 | new_page()
77 | grid(origin, width, height, num_x_units, num_y_units)
78 |
79 | fill(0.9, 0.2, 0.1)
80 | draw_path(dot_count, dot_amp, dot_step+dot_shift)
81 |
82 | fill(0.9, 0.4, 0.1)
83 | draw_path(dot_count, dot_amp-24, dot_step+dot_shift+0.2)
84 |
85 | fill(0.9, 0.9, 0.1)
86 | draw_path(dot_count, dot_amp-48, dot_step+dot_shift+0.4)
87 |
88 | fill(0.2, 0.8, 0.1)
89 | draw_path(dot_count, dot_amp-72, dot_step+dot_shift+0.6)
90 |
91 | fill(0.1, 0.6, 0.9)
92 | draw_path(dot_count, dot_amp-96, dot_step+dot_shift+0.8)
93 |
94 | # fill(0.1, 0.3, 0.9)
95 | # oval(center-10, center-10, dot_size_x, dot_size_y)
96 |
97 | dot_step += 0.195
98 | dot_shift += 0.01
99 | dot_count = seq_step.next()
100 |
101 | saveImage("2017-jan-06.gif")
--------------------------------------------------------------------------------
/2017-01/2017-jan-07.py:
--------------------------------------------------------------------------------
1 | # GIF file rendered with DrawBot: http://www.drawbot.com/
2 |
3 | import math
4 | import itertools
5 |
6 | # static variables
7 | canvas = 512
8 | num_frames = 60
9 |
10 | # gird variables
11 | origin = (128, 128)
12 | width = 256
13 | height = 256
14 | center = width/2
15 | num_x_units = 16
16 | num_y_units = 16
17 |
18 | # dot variables
19 | dot_size_x = 20
20 | dot_size_y = 20
21 | dot_amp = 120
22 | dot_step = 0
23 | dot_count = 1
24 | dot_shift = 0
25 |
26 | #itertools
27 | seq_up = range(2, 60, 2)
28 | seq_dn = range(60, 2, -2)
29 | seq = seq_up + seq_dn
30 | print seq
31 | seq_step = itertools.cycle(seq)
32 |
33 | def new_page():
34 | newPage(canvas, canvas)
35 | frameDuration(1/24)
36 | fill(0.1)
37 | rect(0, 0, canvas, canvas)
38 |
39 | def dot(dot_x, dot_y, dot_size_x, dot_size_y, fill):
40 | stroke(None)
41 | oval((dot_x - 2) + center, (dot_y - 2) + center, dot_size_x, dot_size_y)
42 |
43 | def draw_path(dot_count, dot_amp, dot_step):
44 | for segment in range(dot_count):
45 | dot_x = math.cos(dot_step) * dot_amp
46 | dot_y = math.sin(dot_step) * dot_amp
47 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
48 | dot_step += 0.012 * math.pi
49 |
50 | def draw_path_rev(dot_count, dot_amp, dot_step):
51 | for segment in range(dot_count):
52 | dot_x = math.cos(dot_step) * dot_amp
53 | dot_y = math.sin(dot_step) * dot_amp
54 | dot(dot_x-8, dot_y-8, dot_size_x, dot_size_y, fill)
55 | dot_step -= 0.012 * math.pi
56 |
57 | def grid(origin, width, height, num_x_units, num_y_units):
58 | translate(*origin)
59 | strokeWidth(1)
60 | stroke(0.2)
61 | fill(None)
62 |
63 | step_x = 0
64 | unit_x = width / num_x_units
65 | for x in range(num_x_units + 1):
66 | line((step_x, 0), (step_x, height))
67 | step_x += unit_x
68 |
69 | step_y = 0
70 | unit_y = height / num_y_units
71 | for y in range(num_y_units + 1):
72 | line((0, step_y), (width, step_y))
73 | step_y += unit_y
74 |
75 | for frame in range(num_frames):
76 | new_page()
77 | grid(origin, width, height, num_x_units, num_y_units)
78 |
79 | fill(0.9, 0.2, 0.1)
80 | draw_path(dot_count, dot_amp, dot_step+dot_shift)
81 |
82 | fill(0.9, 0.4, 0.1)
83 | draw_path(dot_count, dot_amp-24, dot_step+dot_shift+0.2)
84 |
85 | fill(0.9, 0.9, 0.1)
86 | draw_path(dot_count, dot_amp-48, dot_step+dot_shift+0.4)
87 |
88 | fill(0.2, 0.8, 0.1)
89 | draw_path(dot_count, dot_amp-72, dot_step+dot_shift+0.6)
90 |
91 | fill(0.1, 0.6, 0.9)
92 | draw_path(dot_count, dot_amp-96, dot_step+dot_shift+0.8)
93 |
94 | # fill(0.1, 0.3, 0.9)
95 | # oval(center-10, center-10, dot_size_x, dot_size_y)
96 |
97 | dot_step += 0.395
98 | dot_shift += 0.01
99 | dot_count = seq_step.next()
100 |
101 | saveImage("2017-jan-06.gif")
--------------------------------------------------------------------------------
/2017-01/2017-jan-08.py:
--------------------------------------------------------------------------------
1 | # To render GIF file, install DrawBot as a module and then run the python script like so: $ python this-file.py
2 |
3 | # To install DrawBot as a module, git clone or download the DrawBot repository from GitHub, Then run the setupAsModule.py script like so: $ python setupAsModule.py
4 |
5 | # DrawBot currently only works with MacOS, but I'm working on a GNU+Linux port.
6 |
7 | # GitHub: https://github.com/typemytype/drawbot
8 | # Web: http://www.drawbot.com/
9 |
10 | # uncomment "from drawBot" line if using setupAsModule.py
11 | # from drawBot import *
12 | import math # for cos, sin and pi functions
13 |
14 | # static variables
15 | canvas = 512 # size of the gif in pixels
16 | num_frames = 100 # number of frames in the animation
17 |
18 | # gird variables
19 | origin = (128, 128)
20 | width = 256
21 | height = 256
22 | center = width/2
23 | num_x_units = 8
24 | num_y_units = 8
25 |
26 | # dot variables
27 | dot_size = 16
28 | amp = 128 # short for amplitude
29 | step = 0 # step in the animation
30 | fake_step = math.pi # a dumb hack >_<
31 | step_string = "{:.8f}".format(fake_step)
32 | x_pos = 0 # x-axis position
33 | y_pos = 0 # y-axis position
34 | r = 1
35 | g = 1
36 | b = 1
37 |
38 | # draws a new frame in the animation
39 | def new_page():
40 | newPage(canvas, canvas) # new page from canvas variable
41 | frameDuration(1/24) # set the dividend to desired FPS (frames per second)
42 | fill(0.1) # color of background
43 | rect(0, 0, canvas, canvas) # draw the background
44 |
45 | # draws the dot from two position variables
46 | def dot(x_pos, y_pos, r, b, g):
47 | fill(1, 0, 0)
48 | stroke(None)
49 | oval(int(x_pos) + center, int(y_pos) + center, dot_size, dot_size)
50 |
51 | # draws a guide showing the sine of dot
52 | def sine_lines(width, height, x_pos, y_pos, r, b, g):
53 | fill(r, g, b)
54 | stroke(None)
55 | oval(center-dot_size/2, center-dot_size/2, dot_size, dot_size)
56 | oval(int(x_pos) + center, center-dot_size/2, dot_size, dot_size)
57 | fill(None)
58 | strokeWidth(3)
59 | stroke(r, g, b)
60 | line((center, center),
61 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
62 | line((center, center),
63 | (int(x_pos) + (center+dot_size/2), center))
64 | line((int(x_pos) + (center+dot_size/2), center),
65 | (int(x_pos) + (center+dot_size/2), int(y_pos) + (center+dot_size/2)))
66 | oval(center-128, center-128, width, height)
67 |
68 | # draws a grid from given arguments
69 | def grid(origin, width, height, num_x_units, num_y_units):
70 | translate(*origin)
71 | strokeWidth(1)
72 | stroke(0.5)
73 | fill(None)
74 |
75 | step_x = 0
76 | unit_x = width / num_x_units
77 | for x in range(num_x_units + 1):
78 | line((step_x, 0), (step_x, height))
79 | step_x += unit_x
80 |
81 | step_y = 0
82 | unit_y = height / num_y_units
83 | for y in range(num_y_units + 1):
84 | line((0, step_y), (width, step_y))
85 | step_y += unit_y
86 |
87 | # draw each frame as a new page
88 | for frame in range(num_frames):
89 | new_page()
90 | grid(origin, width, height, num_x_units, num_y_units)
91 |
92 | # animated dot
93 | x_pos = math.cos(step) * amp
94 | y_pos = -1 * math.sin(step) * amp
95 | x_pos_string = "{:.3f}".format(x_pos)
96 | y_pos_string = "{:.3f}".format(y_pos)
97 | print "x position: ", x_pos_string
98 | print "y position: ", y_pos_string
99 |
100 | sine_lines(width, height, (x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
101 | dot((x_pos)-dot_size/2, (y_pos)-dot_size/2, r, g, b)
102 |
103 | # type
104 | fontSize(24)
105 | font("Helvetica Neue Bold")
106 | tracking(0)
107 | stroke(None)
108 | fill(1, 0, 0)
109 | text(step_string, (-2, -32))
110 |
111 | step += 0.02 * math.pi
112 | step_string = "{:.8f}".format(fake_step)
113 | fake_step -= math.pi / 100
114 |
115 | saveImage("2017-jan-08.gif")
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # drawbot-exercises
2 | Animated gifs made with Python in DrawBot.
3 |
--------------------------------------------------------------------------------