-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathabcs.pbd
135 lines (115 loc) · 2.04 KB
/
abcs.pbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
Target is
..000...
.0...0..
....00..
..00.0..
.0...0..
..0000..
*/
define draw_bottom_line(max_x, max_y) {
draw vector((0, max_y), (max_x, max_y))
}
define figure_eight(left_center, right_center, radius) {
draw circle(left_center, radius * radius)
draw circle(right_center, radius)
draw_bottom_line(7, 11)
//figure_eight(left_center, right_center, radius)
}
define draw_negative_circle(x, y, r) {
draw circle((-x, -y), r * r)
}
define circle_wrapper(point, radius) {
draw circle(point, radius)
}
define add_points(p1, p2) {
draw circle(p1 + p2, 3)
//circle_wrapper(p1 + p2, 3)
}
// the compiler will accept identifiers of length > 1, but it is undefined behavior
// the optional "encoding=INT" behavior explicitly tells the compiler which character this
// should be, given the Adobe Standard Encoding format. If not provided, the compiler will guess
char a {
base {
blank(8, 6)
}
steps {
draw vector((5, 1), (5, 5))
draw vector((2, 5), (5, 5))
draw vector((5, 1), (3, 3))
draw vector((2, 3), (1, 4))
}
}
/*
Target is
........
..000...
.0......
.0......
.0......
..000...
*/
char c {
base {
blank(8, 6)
}
steps {
draw circle ((3, 3), 2)
erase vector((5, 2), (5, 4))
}
}
/*
........
..000...
.0...0..
.0...0..
.0...0..
..000...
*/
char o {
base {
........,
........,
........,
........,
........,
........
}
steps {
draw circle ((3, 3), 2)
}
}
/*
..0000..
.0....0.
.0.00.0.
.0.00.0.
.0....0.
..0000..
*/
char 0 {
base {
blank(8, 16)
}
steps {
draw filled ellipse((0, 0), (7, 15))
erase filled ellipse((1, 1), (6, 14))
draw filled ellipse((3, 7), (4, 8))
}
}
char 8 {
base {
blank(100, 100)
}
steps {
figure_eight((3, 3), (3, 7), 1 + 0 * 1 + 2 * 0 + 1 * 1 * 1 * 1)
}
}
char 9 {
base {
blank(50, 50)
}
steps {
draw_square_spiral((1, 1), 49, 30)
}
}