#N struct 1006.vertex.array.template float x float y array vertex.array 1006.vertex.template; #N struct 1006.vertex.template float x float y float vert.x float vert.y ; #N struct 1006.intersection.template float x float y float vert.x float vert.y; #N struct 1006.grid.y.template float y; #N struct 1006.grid.x.template float x; #N canvas 637 400 639 371 10; #N canvas 332 236 524 521 \$0.canvas 0; #X scalar 1006.vertex.array.template 0 0 \; 50 0 1 0 \; 0 50 0 1 \; 50 100 1 2 \; 0 150 0 3 \; 50 200 1 4 \; 100 150 2 3 \; 150 200 3 4 \; 200 150 4 3 \; 150 100 3 2 \; 200 50 4 1 \; 150 0 3 0 \; 100 50 2 1 \; 50 0 1 0 \; \;; #X scalar 1006.intersection.template 0 0 0 0 \;; #X scalar 1006.intersection.template 50 0 1 0 \;; #X scalar 1006.intersection.template 100 0 2 0 \;; #X scalar 1006.intersection.template 150 0 3 0 \;; #X scalar 1006.intersection.template 200 0 4 0 \;; #X scalar 1006.intersection.template 250 0 5 0 \;; #X scalar 1006.intersection.template 300 0 6 0 \;; #X scalar 1006.intersection.template 350 0 7 0 \;; #X scalar 1006.intersection.template 400 0 8 0 \;; #X scalar 1006.intersection.template 450 0 9 0 \;; #X scalar 1006.intersection.template 500 0 10 0 \;; #X scalar 1006.intersection.template 0 50 0 1 \;; #X scalar 1006.intersection.template 50 50 1 1 \;; #X scalar 1006.intersection.template 100 50 2 1 \;; #X scalar 1006.intersection.template 150 50 3 1 \;; #X scalar 1006.intersection.template 200 50 4 1 \;; #X scalar 1006.intersection.template 250 50 5 1 \;; #X scalar 1006.intersection.template 300 50 6 1 \;; #X scalar 1006.intersection.template 350 50 7 1 \;; #X scalar 1006.intersection.template 400 50 8 1 \;; #X scalar 1006.intersection.template 450 50 9 1 \;; #X scalar 1006.intersection.template 500 50 10 1 \;; #X scalar 1006.intersection.template 0 100 0 2 \;; #X scalar 1006.intersection.template 50 100 1 2 \;; #X scalar 1006.intersection.template 100 100 2 2 \;; #X scalar 1006.intersection.template 150 100 3 2 \;; #X scalar 1006.intersection.template 200 100 4 2 \;; #X scalar 1006.intersection.template 250 100 5 2 \;; #X scalar 1006.intersection.template 300 100 6 2 \;; #X scalar 1006.intersection.template 350 100 7 2 \;; #X scalar 1006.intersection.template 400 100 8 2 \;; #X scalar 1006.intersection.template 450 100 9 2 \;; #X scalar 1006.intersection.template 500 100 10 2 \;; #X scalar 1006.intersection.template 0 150 0 3 \;; #X scalar 1006.intersection.template 50 150 1 3 \;; #X scalar 1006.intersection.template 100 150 2 3 \;; #X scalar 1006.intersection.template 150 150 3 3 \;; #X scalar 1006.intersection.template 200 150 4 3 \;; #X scalar 1006.intersection.template 250 150 5 3 \;; #X scalar 1006.intersection.template 300 150 6 3 \;; #X scalar 1006.intersection.template 350 150 7 3 \;; #X scalar 1006.intersection.template 400 150 8 3 \;; #X scalar 1006.intersection.template 450 150 9 3 \;; #X scalar 1006.intersection.template 500 150 10 3 \;; #X scalar 1006.intersection.template 0 200 0 4 \;; #X scalar 1006.intersection.template 50 200 1 4 \;; #X scalar 1006.intersection.template 100 200 2 4 \;; #X scalar 1006.intersection.template 150 200 3 4 \;; #X scalar 1006.intersection.template 200 200 4 4 \;; #X scalar 1006.intersection.template 250 200 5 4 \;; #X scalar 1006.intersection.template 300 200 6 4 \;; #X scalar 1006.intersection.template 350 200 7 4 \;; #X scalar 1006.intersection.template 400 200 8 4 \;; #X scalar 1006.intersection.template 450 200 9 4 \;; #X scalar 1006.intersection.template 500 200 10 4 \;; #X scalar 1006.intersection.template 0 250 0 5 \;; #X scalar 1006.intersection.template 50 250 1 5 \;; #X scalar 1006.intersection.template 100 250 2 5 \;; #X scalar 1006.intersection.template 150 250 3 5 \;; #X scalar 1006.intersection.template 200 250 4 5 \;; #X scalar 1006.intersection.template 250 250 5 5 \;; #X scalar 1006.intersection.template 300 250 6 5 \;; #X scalar 1006.intersection.template 350 250 7 5 \;; #X scalar 1006.intersection.template 400 250 8 5 \;; #X scalar 1006.intersection.template 450 250 9 5 \;; #X scalar 1006.intersection.template 500 250 10 5 \;; #X scalar 1006.intersection.template 0 300 0 6 \;; #X scalar 1006.intersection.template 50 300 1 6 \;; #X scalar 1006.intersection.template 100 300 2 6 \;; #X scalar 1006.intersection.template 150 300 3 6 \;; #X scalar 1006.intersection.template 200 300 4 6 \;; #X scalar 1006.intersection.template 250 300 5 6 \;; #X scalar 1006.intersection.template 300 300 6 6 \;; #X scalar 1006.intersection.template 350 300 7 6 \;; #X scalar 1006.intersection.template 400 300 8 6 \;; #X scalar 1006.intersection.template 450 300 9 6 \;; #X scalar 1006.intersection.template 500 300 10 6 \;; #X scalar 1006.intersection.template 0 350 0 7 \;; #X scalar 1006.intersection.template 50 350 1 7 \;; #X scalar 1006.intersection.template 100 350 2 7 \;; #X scalar 1006.intersection.template 150 350 3 7 \;; #X scalar 1006.intersection.template 200 350 4 7 \;; #X scalar 1006.intersection.template 250 350 5 7 \;; #X scalar 1006.intersection.template 300 350 6 7 \;; #X scalar 1006.intersection.template 350 350 7 7 \;; #X scalar 1006.intersection.template 400 350 8 7 \;; #X scalar 1006.intersection.template 450 350 9 7 \;; #X scalar 1006.intersection.template 500 350 10 7 \;; #X scalar 1006.intersection.template 0 400 0 8 \;; #X scalar 1006.intersection.template 50 400 1 8 \;; #X scalar 1006.intersection.template 100 400 2 8 \;; #X scalar 1006.intersection.template 150 400 3 8 \;; #X scalar 1006.intersection.template 200 400 4 8 \;; #X scalar 1006.intersection.template 250 400 5 8 \;; #X scalar 1006.intersection.template 300 400 6 8 \;; #X scalar 1006.intersection.template 350 400 7 8 \;; #X scalar 1006.intersection.template 400 400 8 8 \;; #X scalar 1006.intersection.template 450 400 9 8 \;; #X scalar 1006.intersection.template 500 400 10 8 \;; #X scalar 1006.intersection.template 0 450 0 9 \;; #X scalar 1006.intersection.template 50 450 1 9 \;; #X scalar 1006.intersection.template 100 450 2 9 \;; #X scalar 1006.intersection.template 150 450 3 9 \;; #X scalar 1006.intersection.template 200 450 4 9 \;; #X scalar 1006.intersection.template 250 450 5 9 \;; #X scalar 1006.intersection.template 300 450 6 9 \;; #X scalar 1006.intersection.template 350 450 7 9 \;; #X scalar 1006.intersection.template 400 450 8 9 \;; #X scalar 1006.intersection.template 450 450 9 9 \;; #X scalar 1006.intersection.template 500 450 10 9 \;; #X scalar 1006.intersection.template 0 500 0 10 \;; #X scalar 1006.intersection.template 50 500 1 10 \;; #X scalar 1006.intersection.template 100 500 2 10 \;; #X scalar 1006.intersection.template 150 500 3 10 \;; #X scalar 1006.intersection.template 200 500 4 10 \;; #X scalar 1006.intersection.template 250 500 5 10 \;; #X scalar 1006.intersection.template 300 500 6 10 \;; #X scalar 1006.intersection.template 350 500 7 10 \;; #X scalar 1006.intersection.template 400 500 8 10 \;; #X scalar 1006.intersection.template 450 500 9 10 \;; #X scalar 1006.intersection.template 500 500 10 10 \;; #X scalar 1006.grid.y.template 0 \;; #X scalar 1006.grid.y.template 50 \;; #X scalar 1006.grid.y.template 100 \;; #X scalar 1006.grid.y.template 150 \;; #X scalar 1006.grid.y.template 200 \;; #X scalar 1006.grid.y.template 250 \;; #X scalar 1006.grid.y.template 300 \;; #X scalar 1006.grid.y.template 350 \;; #X scalar 1006.grid.y.template 400 \;; #X scalar 1006.grid.y.template 450 \;; #X scalar 1006.grid.y.template 500 \;; #X scalar 1006.grid.x.template 0 \;; #X scalar 1006.grid.x.template 50 \;; #X scalar 1006.grid.x.template 100 \;; #X scalar 1006.grid.x.template 150 \;; #X scalar 1006.grid.x.template 200 \;; #X scalar 1006.grid.x.template 250 \;; #X scalar 1006.grid.x.template 300 \;; #X scalar 1006.grid.x.template 350 \;; #X scalar 1006.grid.x.template 400 \;; #X scalar 1006.grid.x.template 450 \;; #X scalar 1006.grid.x.template 500 \;; #X restore 40 29 pd \$0.canvas; #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 15 80 print vertexclick; #X connect 2 0 0 0; #X connect 2 0 4 0; #X restore 234 97 pd \$0.vertex.template; #N canvas 750 358 516 416 \$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 245 166 plot curve vertex.array 9 2 0 0; #X obj 245 186 plot vertex.array 9 2 0 0; #X obj 239 62 r \$0.curved?.s; #X obj 239 85 sel 0 1; #X msg 269 114 0; #X msg 269 133 1; #X msg 309 114 0; #X msg 309 133 1; #X obj 8 63 route click; #X obj 8 289 element \$0.vertex.array.template vertex.array; #X obj 8 320 get \$0.vertex.template x y vert.x vert.y; #X obj 9 347 pack f f f f; #X obj 9 372 s \$0.vertex-description; #X obj 8 248 t b a; #X msg 8 269 0; #X obj 8 179 r \$0.close-shape; #X obj 375 76 loadbang; #X msg 374 99 0; #X obj 8 224 ds-first pd-\$0.canvas \$0.vertex.array.template; #X obj 8 201 t b; #X connect 0 0 9 0; #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 connect 10 0 11 0; #X connect 11 0 12 0; #X connect 11 1 12 1; #X connect 11 2 12 2; #X connect 11 3 12 3; #X connect 12 0 13 0; #X connect 14 0 15 0; #X connect 14 1 10 1; #X connect 15 0 10 0; #X connect 16 0 20 0; #X connect 17 0 18 0; #X connect 18 0 4 0; #X connect 19 0 14 0; #X connect 20 0 19 0; #X restore 234 117 pd \$0.vertex.array.template; #N canvas 866 124 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 obj 70 140 print; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 1 0 5 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 234 getsize \$0.vertex.array.template vertex.array; #X obj 306 297 setsize \$0.vertex.array.template vertex.array; #X obj 306 211 t a a; #X obj 306 275 + 1; #X obj 194 195 t a a; #X obj 194 335 element \$0.vertex.array.template vertex.array; #X obj 194 279 t b a; #X obj 194 312 f; #X obj 194 174 ds-first pd-\$0.canvas \$0.vertex.array.template; #X obj 15 469 set \$0.vertex.template x y vert.x vert.y; #X obj 682 284 append \$0.vertex.array.template x y; #X msg 682 258 0 0; #X obj 779 258 ds-begin pd-\$0.canvas; #X obj 682 229 t b b; #X msg 682 338 0; #X obj 15 210 t a b; #X obj 682 362 element \$0.vertex.array.template vertex.array; #X obj 645 190 once; #X obj 681 162 r \$0.init-canvas; #X obj 15 47 get \$0.intersection.template x y vert.x vert.y; #X obj 15 74 pack f f f f; #X obj 15 145 r \$0.vertex-description; #X obj 15 101 s \$0.vertex-description; #X text 73 123 API : ); #X obj 742 309 list-value-extend \$0.shape-list; #X obj 682 309 t b a a; #X connect 0 0 20 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 10 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 18 0; #X connect 11 0 26 0; #X connect 12 0 11 0; #X connect 13 0 11 2; #X connect 14 0 12 0; #X connect 14 1 13 0; #X connect 15 0 17 0; #X connect 16 0 10 0; #X connect 16 1 9 0; #X connect 17 0 10 4; #X connect 18 0 14 0; #X connect 19 0 18 1; #X connect 20 0 21 0; #X connect 20 1 21 1; #X connect 20 2 21 2; #X connect 20 3 21 3; #X connect 21 0 23 0; #X connect 22 0 16 0; #X connect 26 0 15 0; #X connect 26 1 17 1; #X connect 26 2 25 0; #X restore 234 142 pd spawn-vertex; #X obj 250 167 bng 15 250 50 0 empty empty reset-drawing 17 7 0 10 -262144 -1 -1; #N canvas 0 22 454 428 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 321 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 232 list-apply * 1; #X msg 68 78 set; #X obj 25 361 outlet; #X obj 26 78 t b b; #X obj 26 290 list-mapx 2; #X obj 147 254 unpack f f; #X obj 146 319 +; #X obj 213 319 +; #X obj 145 342 pack f f; #X obj 120 212 r \$0.scale.s; #X obj 164 273 r \$0.offset.x.s; #X obj 231 293 r \$0.offset.x.s; #X connect 0 0 9 0; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 2 1 4 1; #X connect 3 0 8 0; #X connect 4 0 6 0; #X connect 5 0 1 0; #X connect 6 0 10 0; #X connect 7 0 8 0; #X connect 9 0 5 0; #X connect 9 1 7 0; #X connect 10 0 3 0; #X connect 10 1 11 0; #X connect 11 0 12 0; #X connect 11 1 13 0; #X connect 12 0 14 0; #X connect 13 0 14 1; #X connect 14 0 10 1; #X connect 15 0 6 2; #X connect 16 0 12 1; #X connect 17 0 13 1; #X restore 45 144 pd generate-coordlist; #X obj 45 119 bng 15 250 50 0 empty empty get-points 17 7 0 10 -262144 -1 -1; #X obj 46 63 tgl 15 0 \$0.curved?.s \$0.curved?.r curved? 17 7 0 10 -262144 -1 -1 0 1; #X text -78 631 comment; #X obj -117 639; #X text 61 271 TODO: add variable/scaling/quantize support - option-click a vertex to edit its properties; #X text 57 303 use symbol-boxes and substitution for variables: one ID'd symbol-box per variable \, so you can assign a variable-id when editing your vertexes. surprising: you can use $vars in [symbol/ boxes and they work; #X obj 45 190 outlet; #X obj 46 83 bng 15 250 50 0 \$0.close-shape empty close-shape 17 7 0 10 -262144 -1 -1; #X obj -78 91 nbx 5 14 0.0001 1e+37 0 0 \$0.scale.s \$0.scale.r scale 0 -8 0 10 -262144 -1 -1 1 256; #X obj -78 121 nbx 5 14 0 1e+37 0 0 \$0.offset.x.s \$0.offset.x.r x-offset 0 -8 0 10 -262144 -1 -1 0 256; #X obj -78 151 nbx 5 14 0 1e+37 0 0 \$0.offset.y.s \$0.offset.y.r y-offset 0 -8 0 10 -262144 -1 -1 0 256; #N canvas 21 138 412 554 build-canvas 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 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 obj 35 405 t a a; #X obj 82 87 t b b b b; #X obj 35 456 t a a; #X obj 35 515 append \$0.intersection.template x y vert.x vert.y; #X obj 82 193 * 50; #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 msg 35 338 121; #X msg 82 114 11; #X obj 35 431 mod 11; #X obj 155 431 div 11; #X obj 35 485 * 50; #X obj 155 477 * 50; #X connect 0 0 4 1; #X connect 0 0 5 1; #X connect 1 0 2 0; #X connect 1 0 19 0; #X connect 2 0 1 1; #X connect 3 0 1 0; #X connect 6 0 1 1; #X connect 7 0 8 0; #X connect 9 0 18 4; #X connect 10 0 11 0; #X connect 10 0 15 0; #X connect 11 0 10 1; #X connect 12 0 10 0; #X connect 13 0 10 1; #X connect 14 0 27 0; #X connect 14 1 9 0; #X connect 14 2 13 0; #X connect 14 2 21 0; #X connect 15 0 29 0; #X connect 15 1 30 0; #X connect 16 0 28 0; #X connect 16 1 0 0; #X connect 16 2 6 0; #X connect 16 3 7 0; #X connect 17 0 31 0; #X connect 17 1 18 2; #X connect 19 0 4 0; #X connect 19 0 5 0; #X connect 20 0 23 0; #X connect 22 0 23 0; #X connect 23 0 14 0; #X connect 23 1 16 0; #X connect 24 0 25 0; #X connect 25 0 8 0; #X connect 26 0 23 0; #X connect 27 0 12 0; #X connect 28 0 3 0; #X connect 29 0 17 0; #X connect 30 0 18 3; #X connect 30 0 32 0; #X connect 31 0 18 0; #X connect 32 0 18 1; #X restore 250 186 pd build-canvas; #N canvas 0 22 503 437 init 1; #X msg 162 172 \; \$1.scale.r 1 \;; #X obj 162 101 loadbang; #X obj 162 123 \$0; #X obj 191 123 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 115 293 ds-first pd-\$0.canvas \$0.vertex.array.template; #X obj 120 332 list prepend; #X obj 220 333 t a; #X obj 103 252 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 121 352 print; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 5 0 8 0; #X connect 6 0 5 1; #X connect 7 0 4 0; #X restore 253 227 pd init; #X connect 7 0 20 0; #X connect 8 0 15 0; #X connect 9 0 8 0;