#N struct help-drawpolygon-template float x float y float cat float
dog float weasel;
#N canvas 625 77 589 227 12;
#X text 20 186 see also:;
#X obj 218 187 plot;
#X obj 21 10 drawpolygon;
#X obj 21 34 drawcurve;
#X obj 126 11 filledpolygon;
#X obj 127 34 filledcurve;
#N canvas 371 88 995 511 help-drawpolygon-template 0;
#X obj 574 312 struct help-drawpolygon-template float x float y float
cat float dog float weasel, f 48;
#X text 37 32 Optional flags:;
#X text 34 7 [drawpolygon] and [drawcurve] take these creation arguments:
, f 61;
#X text 39 446 You can change the name of the object to [drawcurve]
and see how it now draws over the 3 points using a bezier curve.,
f 63;
#X text 526 237 You can change the name of the object to [filledcurve]
and see how it now draws a closed shape over the given points using
a bezier curve., f 59;
#X text 535 364 This [struct] object defines the fields for this template.
We have 2 of them in the "data" window and you can see their fields'
values by right-clicking on the object and selecting "properties".
The fields x and y automatically govern the placement of the object
as a whole., f 58;
#X text 121 304 <= inlet sets visibility (1: visible \, 0: invisible)
;
#X msg 53 304 1;
#X msg 86 304 0;
#X msg 543 40 1;
#X msg 576 40 0;
#X text 607 41 <= visibility;
#X text 40 178 Arguments (numbers or field names like "weasel" below).
;
#X text 41 51 - "-n" to make invisible initially or "-v [field name]"
to assign a field to make this visible/invisible (instead of inlet)
\; - "-xr" to disable mouse actions when in "run" mode \; - "-xe" to
disable mouse actions when in "edit" mode (so don't stretch the bounding
rectangle to include this item) \; - "-xv" to disable dragging vertices
when in "run" mode (but keep reporting mouse clicks) \; - "-x" to set
both "-xr" and "-xe" \, disabling all mouse actions \;, f 65;
#X text 62 203 - color (0=black \, 999=white \, 900=red \, 90=green
\, 9=blue \, 555=grey \, etc.) \; - line width \; - (x \, y) pairs
giving coordinates of each vertice in the shape (at least two pairs
to draw a line).;
#X text 142 324 (if no "-v [field name]" flag was given);
#X obj 86 350 drawpolygon 0 5 0 0 25 weasel 50 0;
#X obj 576 69 filledpolygon 900 dog 3 15 0 25 cat 35 0;
#X text 533 104 [filledpolygon] and [filledcurve] take the same inlet
input. As for the arguments \, they take an extra first argument to
specify interior color. Here we have \; - an interior color of red
(900) \; - the outline color controlled by the "dog" field \; - an
outline width of 3 \; - the three pair of coordinates that now describe
a closed and filled triangle of altitude "cat".;
#X text 39 383 The example above has the line color 0 (black) that
is 5 pixels thick and 3 pairs of coordinates to draw an opened triangle
with the height set by "weasel" (this also makes the height settable
via click and dragging \, unless flags disable this)., f 63;
#X connect 7 0 16 0;
#X connect 8 0 16 0;
#X connect 9 0 17 0;
#X connect 10 0 17 0;
#X restore 321 94 pd help-drawpolygon-template;
#N canvas 342 90 282 207 help-drawpolygon-data 1;
#X scalar help-drawpolygon-template 52 28 30 9 70 \;;
#X scalar help-drawpolygon-template 155 102 -30 90 50 \;;
#X coords 0 207 1 206 0 0 0;
#X restore 321 120 pd help-drawpolygon-data;
#X obj 95 187 struct;
#X text 370 188 updated for Pd version 0.51.;
#X text 232 13 - draw shapes for data structures, f 17;
#X text 260 94 open =>;
#X obj 258 187 set;
#X obj 293 187 text;
#X obj 150 187 drawtext;
#X obj 8 67 cnv 1 570 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#N canvas 714 72 569 433 reference 0;
#X obj 6 60 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000
0;
#X obj 6 106 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000
0;
#X obj 6 144 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 5 410 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X text 117 77 float -;
#X obj 22 10 drawpolygon;
#X obj 22 33 drawcurve;
#X obj 111 10 filledpolygon;
#X obj 111 33 filledcurve;
#X text 216 20 - draw shapes for data structures;
#X text 143 116 NONE, f 51;
#X text 174 77 sets visibility (1: visible \, 0: invisible)., f 46
;
#X obj 6 168 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 6 299 cnv 1 550 1 empty empty args: 8 12 0 13 #9f9f9f #000000
0;
#X text 80 192 "-v" <symbol>: assigns a field to make it visible/invisible.
, f 63;
#X text 80 210 "-xr": disable mouse actions when in "run" mode., f
63;
#X text 80 174 "-n": makes it invisible initially., f 63;
#X text 80 228 "-xe": disable mouse actions when in "edit" mode.,
f 63;
#X text 80 246 "-x": set both "-xr" and "-xe" \, disabling all mouse
actions., f 63;
#X text 182 310 line color \, filled shapes have an extra first interior
color. (default 0 \, 0)., f 48;
#X text 97 311 1) float* -;
#X text 98 342 2) float* - line width (default 1)., f 60;
#X text 145 383 * all of the above can also be field names.;
#X text 112 361 3 list* - (x \, y) pairs giving coordinates of each
vertice.;
#X text 80 264 "-xv":;
#X text 128 264 disable dragging vertices when in "run" mode (keeps
reporting mouse clicks)., f 56;
#X restore 407 22 pd reference;
#X text 505 23 <= click;
#X obj 8 173 cnv 1 570 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 40 95 Use these to draw polygon and curved shapes., f 26;
