#N canvas 805 217 632 642 10; #X obj 244 185 #polygon_radial_map; #X text 70 40 makes a 1-D panoramic (polar) rendering of a polygon. ; #X text 69 57 if you want to make standardized (translation-independent) renderings of polygons \, first substract [#polygon_moment] (or a variant thereof) from the polygon.; #X obj 244 280 #outer * (255 255 255); #X obj 244 299 #out window; #X obj 24 193 t b a; #X obj 24 240 #draw_polygon put (255 224 200); #X msg 24 221 240 320 3 # 0 60 90; #X obj 244 242 #for 128 0 -1; #X obj 24 259 #out window; #X obj 244 140 #t; #X obj 293 162 display; #X obj 244 166 # -; #X obj 392 183 display; #X msg 24 116 4 2 # 30 30 30 250 120 200 170 90; #X obj 244 204 t a a; #X obj 244 223 #finished; #X obj 244 261 #outer <; #X obj 0 0 doc_h; #X obj 3 333 doc_c 0; #X obj 3 373 doc_i 1; #X obj 3 457 doc_o 1; #X obj 14 487 doc_oo 0; #X obj 14 403 doc_ii 0; #X obj 0 630 doc_f; #X obj 97 487 doc_m o0 grid; #X obj 97 403 doc_m i0 grid; #X obj 3 610 doc_also; #X obj 274 141 #polygon_moment; #X obj 97 425 doc_m i0 precision; #X text 232 425 number of elements in output; #X text 232 487 dim(precision): radial map. for each angle 36000*a/precision \, it gives the radius of the polygon in that direction. this only works reliably when all edges go in the same direction in polar coords (all clockwise or all counterclockwise). thus it works on all convex polygons as long as the origin is inside \, but it also works on many concave polygons as long as you pick the origin appropriately.; #X obj 103 610 #polygon_comparator; #X text 232 403 dim(vertices \, 2): polygon; #X connect 0 0 15 0; #X connect 3 0 4 0; #X connect 5 0 7 0; #X connect 5 1 6 2; #X connect 6 0 9 0; #X connect 7 0 6 0; #X connect 8 0 17 0; #X connect 10 0 12 0; #X connect 10 1 28 0; #X connect 12 0 0 0; #X connect 12 0 13 0; #X connect 14 0 5 0; #X connect 14 0 10 0; #X connect 15 0 16 0; #X connect 15 1 17 1; #X connect 16 0 8 0; #X connect 17 0 3 0; #X connect 25 1 31 0; #X connect 26 1 33 0; #X connect 27 1 32 0; #X connect 28 0 11 0; #X connect 28 0 12 1; #X connect 29 1 30 0;