#N struct 1079-DS float color float x float y;
#N canvas 449 122 488 446 12;
#X declare -path else;
#N canvas 408 46 478 607 template 0;
#X obj 144 301 drawcurve color 2 0 0 50 100 100 0;
#X obj 99 560 filledcurve color 0 5 0 100 100 100 50 50;
#X text 123 126 draw the color number variable;
#X obj 105 153 drawnumber color 100 50 color color=;
#X text 44 210 And now we include curved shapes. The [drawcurve] works
in the same way as [drawpolygon] object. The first argument is a float
that defines the color (again defined by the "color" float as defined
in [struct])., f 51;
#X obj 96 83 struct \$0-DS float color float x float y;
#X text 94 26 Data Structure named "\$0-DS" holding a float called
"color" and x/y coordinates., f 43;
#X text 51 345 The second argument is the line width of the curve in
pixels. The next arguments are pairs of point coordinates to connect
with the line \, which is now curved with a bezier function passing
through the ccoordinate points. Here we have just three pairs of coordinates
(0/0) \, (50/100) and (100/0) - so a curved line is drawn to connect
these three dots., f 52;
#X text 80 465 The [filledcurve] object is also similar to [filledpolygon]
\, it needs an extra first argument to set interior color and now all
dots are connected to form a closed shape also curved with a bezir
function., f 43;
#X restore 227 159 pd template;
#N canvas 938 199 282 196 \$0-display 0;
#X scalar 1079-DS 506 60 47 \;;
#X restore 227 186 pd \$0-display;
#X obj 215 335 pointer;
#X obj 64 368 append \$0-DS color x y;
#X msg 336 211 clear \, vis 1;
#X obj 336 235 s pd-\$0-display;
#X obj 242 33 declare -path else;
#X text 44 78 Now let's have some fun with curved shapes. See the [pd
template] subpatch for details. As in the last example \, click and
drag the "color" number to see the colors changing., f 52;
#X obj 215 289 message traverse pd-\$0-display \, bang, f 31;
#X obj 64 233 trigger list bang bang, f 32;
#X obj 64 173 initmess 500 50 50;
#X listbox 64 203 10 0 0 0 - - - 0;
#X text 313 158 <= click;
#X connect 2 0 3 3;
#X connect 4 0 5 0;
#X connect 8 0 2 0;
#X connect 9 0 3 0;
#X connect 9 1 8 0;
#X connect 9 2 4 0;
#X connect 10 0 11 0;
#X connect 11 0 9 0;
