aboutsummaryrefslogtreecommitdiff
path: root/ds-designer.pd
blob: dd2b06712e5493432dcd7fc365fdfc56bb967fa8 (plain)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#N struct 1002.vertex.array.template float x float y array vertex.array
1002.vertex.template;
#N struct 1002.vertex.template float x float y float vert.x float vert.y
;
#N struct 1002.intersection.template float x float y float vert.x float
vert.y;
#N struct 1002.grid.y.template float y;
#N struct 1002.grid.x.template float x;
#N canvas 916 311 479 259 10;
#N canvas 400 22 515 519 \$0.canvas 1;
#X scalar 1002.vertex.array.template 0 0 \; 100 50 2 1 \; 150 100 3
2 \; 200 50 4 1 \; 250 100 5 2 \; 200 150 4 3 \; 250 200 5 4 \; 200
250 4 5 \; 150 200 3 4 \; 100 250 2 5 \; 50 200 1 4 \; 100 150 2 3
\; 50 100 1 2 \; \;;
#X scalar 1002.intersection.template 0 0 0 0 \;;
#X scalar 1002.intersection.template 50 0 1 0 \;;
#X scalar 1002.intersection.template 100 0 2 0 \;;
#X scalar 1002.intersection.template 150 0 3 0 \;;
#X scalar 1002.intersection.template 200 0 4 0 \;;
#X scalar 1002.intersection.template 250 0 5 0 \;;
#X scalar 1002.intersection.template 300 0 6 0 \;;
#X scalar 1002.intersection.template 350 0 7 0 \;;
#X scalar 1002.intersection.template 400 0 8 0 \;;
#X scalar 1002.intersection.template 450 0 9 0 \;;
#X scalar 1002.intersection.template 0 50 0 1 \;;
#X scalar 1002.intersection.template 50 50 1 1 \;;
#X scalar 1002.intersection.template 100 50 2 1 \;;
#X scalar 1002.intersection.template 150 50 3 1 \;;
#X scalar 1002.intersection.template 200 50 4 1 \;;
#X scalar 1002.intersection.template 250 50 5 1 \;;
#X scalar 1002.intersection.template 300 50 6 1 \;;
#X scalar 1002.intersection.template 350 50 7 1 \;;
#X scalar 1002.intersection.template 400 50 8 1 \;;
#X scalar 1002.intersection.template 450 50 9 1 \;;
#X scalar 1002.intersection.template 0 100 0 2 \;;
#X scalar 1002.intersection.template 50 100 1 2 \;;
#X scalar 1002.intersection.template 100 100 2 2 \;;
#X scalar 1002.intersection.template 150 100 3 2 \;;
#X scalar 1002.intersection.template 200 100 4 2 \;;
#X scalar 1002.intersection.template 250 100 5 2 \;;
#X scalar 1002.intersection.template 300 100 6 2 \;;
#X scalar 1002.intersection.template 350 100 7 2 \;;
#X scalar 1002.intersection.template 400 100 8 2 \;;
#X scalar 1002.intersection.template 450 100 9 2 \;;
#X scalar 1002.intersection.template 0 150 0 3 \;;
#X scalar 1002.intersection.template 50 150 1 3 \;;
#X scalar 1002.intersection.template 100 150 2 3 \;;
#X scalar 1002.intersection.template 150 150 3 3 \;;
#X scalar 1002.intersection.template 200 150 4 3 \;;
#X scalar 1002.intersection.template 250 150 5 3 \;;
#X scalar 1002.intersection.template 300 150 6 3 \;;
#X scalar 1002.intersection.template 350 150 7 3 \;;
#X scalar 1002.intersection.template 400 150 8 3 \;;
#X scalar 1002.intersection.template 450 150 9 3 \;;
#X scalar 1002.intersection.template 0 200 0 4 \;;
#X scalar 1002.intersection.template 50 200 1 4 \;;
#X scalar 1002.intersection.template 100 200 2 4 \;;
#X scalar 1002.intersection.template 150 200 3 4 \;;
#X scalar 1002.intersection.template 200 200 4 4 \;;
#X scalar 1002.intersection.template 250 200 5 4 \;;
#X scalar 1002.intersection.template 300 200 6 4 \;;
#X scalar 1002.intersection.template 350 200 7 4 \;;
#X scalar 1002.intersection.template 400 200 8 4 \;;
#X scalar 1002.intersection.template 450 200 9 4 \;;
#X scalar 1002.intersection.template 0 250 0 5 \;;
#X scalar 1002.intersection.template 50 250 1 5 \;;
#X scalar 1002.intersection.template 100 250 2 5 \;;
#X scalar 1002.intersection.template 150 250 3 5 \;;
#X scalar 1002.intersection.template 200 250 4 5 \;;
#X scalar 1002.intersection.template 250 250 5 5 \;;
#X scalar 1002.intersection.template 300 250 6 5 \;;
#X scalar 1002.intersection.template 350 250 7 5 \;;
#X scalar 1002.intersection.template 400 250 8 5 \;;
#X scalar 1002.intersection.template 450 250 9 5 \;;
#X scalar 1002.intersection.template 0 300 0 6 \;;
#X scalar 1002.intersection.template 50 300 1 6 \;;
#X scalar 1002.intersection.template 100 300 2 6 \;;
#X scalar 1002.intersection.template 150 300 3 6 \;;
#X scalar 1002.intersection.template 200 300 4 6 \;;
#X scalar 1002.intersection.template 250 300 5 6 \;;
#X scalar 1002.intersection.template 300 300 6 6 \;;
#X scalar 1002.intersection.template 350 300 7 6 \;;
#X scalar 1002.intersection.template 400 300 8 6 \;;
#X scalar 1002.intersection.template 450 300 9 6 \;;
#X scalar 1002.intersection.template 0 350 0 7 \;;
#X scalar 1002.intersection.template 50 350 1 7 \;;
#X scalar 1002.intersection.template 100 350 2 7 \;;
#X scalar 1002.intersection.template 150 350 3 7 \;;
#X scalar 1002.intersection.template 200 350 4 7 \;;
#X scalar 1002.intersection.template 250 350 5 7 \;;
#X scalar 1002.intersection.template 300 350 6 7 \;;
#X scalar 1002.intersection.template 350 350 7 7 \;;
#X scalar 1002.intersection.template 400 350 8 7 \;;
#X scalar 1002.intersection.template 450 350 9 7 \;;
#X scalar 1002.intersection.template 0 400 0 8 \;;
#X scalar 1002.intersection.template 50 400 1 8 \;;
#X scalar 1002.intersection.template 100 400 2 8 \;;
#X scalar 1002.intersection.template 150 400 3 8 \;;
#X scalar 1002.intersection.template 200 400 4 8 \;;
#X scalar 1002.intersection.template 250 400 5 8 \;;
#X scalar 1002.intersection.template 300 400 6 8 \;;
#X scalar 1002.intersection.template 350 400 7 8 \;;
#X scalar 1002.intersection.template 400 400 8 8 \;;
#X scalar 1002.intersection.template 450 400 9 8 \;;
#X scalar 1002.intersection.template 0 450 0 9 \;;
#X scalar 1002.intersection.template 50 450 1 9 \;;
#X scalar 1002.intersection.template 100 450 2 9 \;;
#X scalar 1002.intersection.template 150 450 3 9 \;;
#X scalar 1002.intersection.template 200 450 4 9 \;;
#X scalar 1002.intersection.template 250 450 5 9 \;;
#X scalar 1002.intersection.template 300 450 6 9 \;;
#X scalar 1002.intersection.template 350 450 7 9 \;;
#X scalar 1002.intersection.template 400 450 8 9 \;;
#X scalar 1002.intersection.template 450 450 9 9 \;;
#X scalar 1002.grid.y.template 0 \;;
#X scalar 1002.grid.y.template 50 \;;
#X scalar 1002.grid.y.template 100 \;;
#X scalar 1002.grid.y.template 150 \;;
#X scalar 1002.grid.y.template 200 \;;
#X scalar 1002.grid.y.template 250 \;;
#X scalar 1002.grid.y.template 300 \;;
#X scalar 1002.grid.y.template 350 \;;
#X scalar 1002.grid.y.template 400 \;;
#X scalar 1002.grid.y.template 450 \;;
#X scalar 1002.grid.x.template 0 \;;
#X scalar 1002.grid.x.template 50 \;;
#X scalar 1002.grid.x.template 100 \;;
#X scalar 1002.grid.x.template 150 \;;
#X scalar 1002.grid.x.template 200 \;;
#X scalar 1002.grid.x.template 250 \;;
#X scalar 1002.grid.x.template 300 \;;
#X scalar 1002.grid.x.template 350 \;;
#X scalar 1002.grid.x.template 400 \;;
#X scalar 1002.grid.x.template 450 \;;
#X restore 40 29 pd \$0.canvas;
#N canvas 738 215 412 554 grid 0;
#X obj 138 151 ds-begin pd-\$0.canvas;
#X obj 82 171 f;
#X obj 107 171 + 1;
#X obj 82 143 until;
#X msg 82 114 10;
#X obj 82 225 append \$0.grid.x.template x;
#X obj 110 254 append \$0.grid.y.template y;
#X msg 137 114 0;
#X msg 187 70 clear;
#X obj 187 101 s pd-\$0.canvas;
#X obj 206 381 ds-begin pd-\$0.canvas;
#X obj 35 380 f;
#X obj 60 380 + 1;
#X obj 35 359 until;
#X msg 205 344 0;
#X obj 35 317 t b b b;
#X msg 35 338 100;
#X obj 35 425 t a a;
#X obj 82 87 t b b b b;
#X obj 36 476 t a a;
#X obj 35 505 append \$0.intersection.template x y vert.x vert.y;
#X obj 35 401 * 50;
#X obj 82 193 * 50;
#X obj 35 451 mod 500;
#X obj 86 475 / 50;
#X obj 155 477 * 50;
#X obj 155 451 div 500;
#X obj 35 9 inlet;
#X obj 122 315 s \$0.init-canvas;
#X obj 66 30 loadbang;
#X obj 35 46 t b b;
#X obj 250 22 loadbang;
#X msg 250 48 vis 1;
#X obj 77 9 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X connect 0 0 5 1;
#X connect 0 0 6 1;
#X connect 1 0 2 0;
#X connect 1 0 22 0;
#X connect 2 0 1 1;
#X connect 3 0 1 0;
#X connect 4 0 3 0;
#X connect 7 0 1 1;
#X connect 8 0 9 0;
#X connect 10 0 20 4;
#X connect 11 0 12 0;
#X connect 11 0 21 0;
#X connect 12 0 11 1;
#X connect 13 0 11 0;
#X connect 14 0 11 1;
#X connect 15 0 16 0;
#X connect 15 1 10 0;
#X connect 15 2 14 0;
#X connect 15 2 28 0;
#X connect 16 0 13 0;
#X connect 17 0 23 0;
#X connect 17 1 26 0;
#X connect 18 0 4 0;
#X connect 18 1 0 0;
#X connect 18 2 7 0;
#X connect 18 3 8 0;
#X connect 19 0 20 0;
#X connect 19 1 24 0;
#X connect 21 0 17 0;
#X connect 22 0 5 0;
#X connect 22 0 6 0;
#X connect 23 0 19 0;
#X connect 24 0 20 2;
#X connect 25 0 20 1;
#X connect 26 0 20 3;
#X connect 26 0 25 0;
#X connect 27 0 30 0;
#X connect 29 0 30 0;
#X connect 30 0 15 0;
#X connect 30 1 18 0;
#X connect 31 0 32 0;
#X connect 32 0 9 0;
#X connect 33 0 30 0;
#X restore 250 186 pd grid;
#N canvas 853 469 450 300 \$0.grid.x.template 0;
#X obj 53 55 struct \$0.grid.x.template float x;
#X obj 54 113 drawpolygon 0 1 0 0 0 500;
#X restore 233 27 pd \$0.grid.x.template;
#N canvas 853 450 450 300 \$0.grid.y.template 0;
#X obj 53 55 struct \$0.grid.y.template float y;
#X obj 53 83 drawpolygon 0 1 0 0 500 0;
#X restore 233 47 pd \$0.grid.y.template;
#N canvas 621 85 450 300 \$0.vertex.template 0;
#X obj 15 55 route click;
#X obj 15 107 get \$0.vertex.template vert.x vert.y;
#X obj 15 19 struct \$0.vertex.template float x float y float vert.x
float vert.y;
#X obj 86 247 filledpolygon 990 909 1 -2 -2 2 -2 2 2 -2 2 -2 -2;
#X obj 30 80 print;
#X connect 2 0 0 0;
#X connect 2 0 4 0;
#X restore 234 97 pd \$0.vertex.template;
#N canvas 155 354 450 300 \$0.vertex.array.template 0;
#X obj 8 26 struct \$0.vertex.array.template float x float y array
vertex.array \$0.vertex.template;
#X obj 18 177 plot curve vertex.array 9 2 0 0;
#X obj 18 217 plot vertex.array 9 2 0 0;
#X obj 12 73 r \$0.curved?.s;
#X obj 12 96 sel 0 1;
#X msg 42 125 0;
#X msg 42 144 1;
#X msg 82 125 0;
#X msg 82 144 1;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 4 0 6 0;
#X connect 4 1 7 0;
#X connect 4 1 8 0;
#X connect 5 0 1 0;
#X connect 6 0 2 0;
#X connect 7 0 2 0;
#X connect 8 0 1 0;
#X restore 234 117 pd \$0.vertex.array.template;
#N canvas 688 22 450 300 \$0.intersection.template 0;
#X obj 15 55 route click;
#X obj 15 19 struct \$0.intersection.template float x float y float
vert.x float vert.y;
#X text 114 56 click an intersection to spawn a vertex;
#X obj 15 78 s \$0.spawn-vertex;
#X obj 86 246 filledpolygon 900 90 1 -4 -4 4 -4 4 4 -4 4 -4 -4;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X restore 234 67 pd \$0.intersection.template;
#N canvas 332 236 1076 560 spawn-vertex 0;
#X obj 15 21 r \$0.spawn-vertex;
#X obj 306 194 getsize \$0.vertex.array.template vertex.array;
#X obj 306 257 setsize \$0.vertex.array.template vertex.array;
#X obj 306 171 t a a;
#X obj 306 235 + 1;
#X obj 194 155 t a a;
#X obj 194 295 element \$0.vertex.array.template vertex.array;
#X obj 194 239 t b a;
#X obj 194 272 f;
#X obj 194 134 ds-first pd-\$0.canvas \$0.vertex.array.template;
#X obj 15 347 get \$0.intersection.template x y vert.x vert.y;
#X obj 15 429 set \$0.vertex.template x y vert.x vert.y;
#X obj 15 394 pack f f f f;
#X obj 682 244 append \$0.vertex.array.template x y;
#X msg 682 218 0 0;
#X obj 779 218 ds-begin pd-\$0.canvas;
#X obj 682 189 t b b;
#X msg 682 298 0;
#X obj 682 270 t b a;
#X obj 15 50 t a b;
#X obj 682 322 element \$0.vertex.array.template vertex.array;
#X obj 645 150 once;
#X obj 681 122 r \$0.init-canvas;
#X connect 0 0 19 0;
#X connect 1 0 4 0;
#X connect 3 0 1 0;
#X connect 3 1 2 1;
#X connect 4 0 2 0;
#X connect 4 0 8 1;
#X connect 5 0 7 0;
#X connect 5 1 3 0;
#X connect 6 0 11 4;
#X connect 7 0 8 0;
#X connect 7 1 6 1;
#X connect 8 0 6 0;
#X connect 9 0 5 0;
#X connect 9 1 21 0;
#X connect 10 0 12 0;
#X connect 10 1 12 1;
#X connect 10 2 12 2;
#X connect 10 3 12 3;
#X connect 12 0 11 0;
#X connect 13 0 18 0;
#X connect 14 0 13 0;
#X connect 15 0 13 2;
#X connect 16 0 14 0;
#X connect 16 1 15 0;
#X connect 17 0 20 0;
#X connect 18 0 17 0;
#X connect 18 1 20 1;
#X connect 19 0 10 0;
#X connect 19 1 9 0;
#X connect 20 0 11 4;
#X connect 21 0 16 0;
#X connect 22 0 21 1;
#X restore 234 142 pd spawn-vertex;
#X msg 45 208 10 0 20 10 30 0 40 10 30 20 40 30 30 40 20 30 10 40 0
30 10 20 0 10;
#X obj 250 167 bng 15 250 50 0 empty empty reset-drawing 17 7 0 10
-262144 -1 -1;
#N canvas 0 22 453 392 generate-coordlist 0;
#X obj 26 50 inlet;
#X obj 26 133 ds-dump-array \$0.vertex.array.template vertex.array
;
#X obj 26 167 get \$0.vertex.template vert.x vert.y;
#X msg 26 299 add2 \$1 \$2;
#X obj 26 206 pack f f;
#X obj 26 99 ds-first pd-\$0.canvas \$0.vertex.array.template;
#X obj 26 262 list-apply * 1;
#X floatatom 139 263 5 0 0 0 - - -;
#X obj 26 78 t a b;
#X msg 68 78 set;
#X obj 26 241 list-apply + 0;
#X msg 139 241 -1;
#X text 168 239 diag-offset;
#X obj 25 339 outlet;
#X text 181 263 scaling;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 2 1 4 1;
#X connect 3 0 13 0;
#X connect 4 0 10 0;
#X connect 5 0 1 0;
#X connect 6 0 3 0;
#X connect 7 0 6 2;
#X connect 8 0 5 0;
#X connect 8 1 9 0;
#X connect 9 0 13 0;
#X connect 10 0 6 0;
#X connect 11 0 10 2;
#X restore 45 144 pd generate-coordlist;
#X obj 46 119 bng 15 250 50 0 empty empty get-points 17 7 0 10 -262144
-1 -1;
#X obj 46 73 tgl 15 0 \$0.curved?.s \$0.curved?.r curved? 17 7 0 10
-262144 -1 -1 0 1;
#X connect 9 0 1 0;
#X connect 10 0 8 0;
#X connect 11 0 10 0;