-
Notifications
You must be signed in to change notification settings - Fork 2
/
of.path-help.pd
288 lines (288 loc) · 9.19 KB
/
of.path-help.pd
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
#N canvas 568 38 666 732 12;
#X declare -lib ofelia;
#X obj 9 10 cnv 15 600 60 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 17 111 of.draw;
#X obj 462 45 declare -lib ofelia;
#X obj 17 174 of.rotate;
#X floatatom 57 144 5 0 0 1 Rotation - -;
#X msg 63 482 mode \$1;
#N canvas 776 360 411 332 draw_with_mouse 0;
#X obj 44 87 of.mouse;
#X obj 44 160 spigot, f 8;
#X obj 97 116 t a a;
#X msg 129 165 close;
#X obj 129 140 sel 0;
#X msg 44 200 curveto \$1 \$2 0;
#X obj 19 251 s \$0-path;
#X msg 19 47 filled 0 \, stroke 1;
#X text 169 205 draw curve shape at x \, y \, z;
#X text 175 130 -> on click release \, close the last shape (will start
another shape), f 19;
#X text 19 26 better for a line:;
#X connect 0 0 1 0;
#X connect 0 1 2 0;
#X connect 1 0 5 0;
#X connect 2 0 1 1;
#X connect 2 1 4 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 7 0 6 0;
#X restore 393 324 pd draw_with_mouse;
#X text 25 20 Draw a path (experimental);
#X obj 63 458 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 84 452 0 COMMANDS 1 POLYLINES, f 11;
#X text 24 40 Args: mode (0 = COMMANDS 1 = POLYLINES);
#X msg 60 420 polywinding \$1;
#X obj 60 399 hradio 15 1 0 5 empty empty empty 0 -8 0 10 -262144 -1
-1 1;
#X msg 64 508 get;
#X obj 66 546 r \$0-path;
#X text 396 206 more...;
#X obj 17 579 of.path, f 18;
#X msg 60 375 clear;
#X text 29 198 x \, y \, z \, radiusX \, radiusY \, angleBegin \, angleEnd
, f 27;
#N canvas 848 231 311 351 Style_&_Color 0;
#X text 44 4 style;
#X msg 47 106 color 255 55 0;
#X msg 47 136 strokecolor 5 140 130;
#X msg 47 166 fillcolor 105 14 190;
#X msg 46 76 stroke 10;
#X msg 48 216 useshapecolor \$1;
#X obj 48 196 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 14 268 s \$0-path;
#X msg 44 46 filled \$1;
#X obj 44 28 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X text 60 27 -> if 0 \, need stroke > 0;
#X text 70 194 if set to 0 \, use :;
#X obj 210 195 of.color;
#X text 154 106 -> stroke and fill;
#X connect 1 0 7 0;
#X connect 2 0 7 0;
#X connect 3 0 7 0;
#X connect 4 0 7 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 0 7 0;
#X connect 8 0 7 0;
#X connect 9 0 8 0;
#X restore 393 252 pd Style_&_Color;
#N canvas 399 364 1063 278 move_&_draw 0;
#X msg 51 147 quadbezierto -100 300 0 -100 0 10 200 20 20;
#X msg 51 7 moveto 0 0 0;
#X obj 22 206 s \$0-path;
#X obj 506 217 s \$0-path;
#X text 498 50 1;
#X text 498 77 2;
#X text 498 107 3;
#X text 498 137 4;
#X text 515 29 Quad step by step example;
#X msg 518 170 close;
#X text 497 172 5;
#X text 54 170 https://openframeworks.cc/documentation/graphics/ofPath/#show_quadBezierTo
;
#X msg 51 97 bezierto -100 200 0 200 20 -100;
#X text 54 113 https://openframeworks.cc/documentation/graphics/ofPath/#show_bezierTo
;
#X msg 51 67 curveto -100 -100 0;
#X msg 51 37 lineto -200 200 0;
#X msg 188 36 lineto \$1 200 0;
#X floatatom 188 8 5 0 0 0 - - -;
#X msg 721 151 clear;
#X msg 718 117 curveto 100 0 \, curveto 0 100 \, curveto -100 0;
#X msg 517 50 lineto -100 100;
#X msg 517 77 lineto 100 50;
#X msg 519 107 lineto 0 -100;
#X msg 519 137 lineto -100 -100;
#X msg 716 88 curveto \$1 -100 0;
#X floatatom 719 64 5 0 0 0 - - -;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 9 0 3 0;
#X connect 12 0 2 0;
#X connect 14 0 2 0;
#X connect 15 0 2 0;
#X connect 16 0 2 0;
#X connect 17 0 16 0;
#X connect 18 0 3 0;
#X connect 19 0 3 0;
#X connect 20 0 3 0;
#X connect 21 0 3 0;
#X connect 22 0 3 0;
#X connect 23 0 3 0;
#X connect 24 0 3 0;
#X connect 25 0 24 0;
#X restore 393 300 pd move_&_draw;
#X msg 41 263 triangle -200 0 0 200 200 0;
#X msg 31 233 arc 0 -50 0 100 100 0 180;
#X msg 49 289 rectangle -100 -100 0 200 200;
#X msg 133 346 filled 1;
#X text 184 82 [of.path] is a way to create a path or multiple paths
consisting of points. It allows you to combine multiple paths consisting
of points into a single vector data object that can be drawn to the
screen \, manipulated point by point \, or manipulated with it's child
subpaths.;
#X text 186 155 By default ofPath uses ofSubPath instances. Closing
the path automatically creates a new path:;
#X msg 59 346 filled 0;
#X msg 49 316 stroke 1;
#X text 189 316 need this if not filled;
#X msg 122 316 stroke 5;
#N canvas 647 374 565 332 local_transformation 0;
#X msg 57 133 simplify 6;
#X msg 57 163 tessellate 3;
#X msg 57 103 scale 2 2 2;
#X msg 57 43 orientation 0 0 360;
#X text 57 25 Add transformation;
#X msg 57 73 position 0 0 -10;
#X obj 30 242 s \$0-path;
#X text 250 116 Add transformation;
#X obj 250 164 s \$0-path;
#X obj 250 96 metro 40;
#X obj 250 72 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 250 134 orientation 0 0 360 \, position 0 0 -10;
#X text 243 46 Exemple:;
#X connect 0 0 6 0;
#X connect 1 0 6 0;
#X connect 2 0 6 0;
#X connect 3 0 6 0;
#X connect 5 0 6 0;
#X connect 9 0 11 0;
#X connect 10 0 9 0;
#X connect 11 0 8 0;
#X restore 393 277 pd local_transformation;
#X obj 518 19 of.window 1;
#X obj 497 21 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 95 509 get infos from right outlet;
#X text 146 396 -> https://openframeworks.cc/documentation/graphics/winding_modes.gif
, f 69;
#N canvas 636 207 1030 699 shapes 0;
#X msg 63 362 triangle 0 100 100 0 -100 0;
#X msg 63 102 rectrounded -100 -50 0 100 100 10 20 100 60;
#X obj 27 629 s \$0-path;
#X msg 460 16 clear;
#X msg 446 236 outline;
#X msg 460 52 close;
#X msg 450 211 append;
#X msg 420 127 newsubpath;
#X obj 382 169 s \$0-path;
#X msg 426 282 tessellate;
#X msg 363 331 curveresolution 100;
#X msg 63 28 rectrounded 0 0 100 100 20;
#X text 64 54 x \, y \, z \, width \, height \, topLeftRadius \, float
topRightRadius \, float bottomRightRadius \, float bottomLeftRadius
, f 47;
#X text 64 4 x \, y \, width \, height \, rardius;
#X text 65 121 x \, y \, width \, height;
#X text 65 158 x \, y \, z \, width \, height;
#X msg 63 175 rectangle 30 20 100 100 100;
#X msg 63 212 circle 0 0 200;
#X msg 63 246 circle -100 0 0 50;
#X text 65 304 x \, y \, z \, width \, height;
#X text 65 265 x \, y \, width \, height;
#X msg 63 282 ellipse -50 40 50 200;
#X msg 63 321 ellipse 50 40 -50 50 200;
#X text 65 344 x1 \, y1 \, x2 \, y2 \, x3 \, y3;
#X text 65 379 x1 \, y1 \, z1 x2 \, y2 \, z2 \, x3 \, y3 \, z3;
#X msg 63 397 triangle -100 -100 -100 100 -100 0 100 100 -300;
#X text 65 454 x \, y \, z \, radiusX \, radiusY \, angleBegin \, angleEnd
;
#X text 65 419 x \, y \, radiusX \, radiusY \, angleBegin \, angleEnd
;
#X msg 63 472 arc 0 0 0 100 100 60 290;
#X msg 64 436 arc 50 50 100 100 90 -90;
#X text 65 494 x \, y \, radiusX \, radiusY \, angleBegin \, angleEnd)
;
#X text 65 534 x \, y \, z \, radiusX \, radiusY \, angleBegin \, angleEnd)
;
#X msg 63 552 arcnegative 0 0 100 -100 50 30 190;
#X msg 63 512 arcnegative 0 0 100 50 30 98;
#X text 534 128 Creates a new subpath \, either an ofPolyline instance
or an ofSubPath instance. All points added after a call to ofSubPath
will be done in the newly created subpath. Calling close() automatically
calls create newSubPath() \, ensuring that the closed path doesn't
have new points added to it.;
#X text 534 18 Removes all subpaths from the ofPath instance.;
#X text 534 48 Closes the current subpath and creates a new subpath
\, either an ofPolyline or ofSubPath by calling newSubPath() \, ensuring
that the closed path doesn't have new points added to it.;
#X obj 275 309 s \$0-path;
#X msg 412 259 simplify 0.2;
#X msg 73 581 clear;
#X msg 363 308 circleresolution 10;
#X text 534 308 Resolution for circle \, ellipse \, arc and arcnegative
;
#X text 65 193 x \, y \, size;
#X text 65 227 x \, y \, z \, size;
#X text 534 328 Resolution for circle \, ellipse \, arc and arcnegative
;
#X msg 63 142 rectangle 30 20 100 100;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 3 0 8 0;
#X connect 4 0 37 0;
#X connect 5 0 8 0;
#X connect 6 0 37 0;
#X connect 7 0 8 0;
#X connect 9 0 37 0;
#X connect 10 0 37 0;
#X connect 11 0 2 0;
#X connect 16 0 2 0;
#X connect 17 0 2 0;
#X connect 18 0 2 0;
#X connect 21 0 2 0;
#X connect 22 0 2 0;
#X connect 25 0 2 0;
#X connect 28 0 2 0;
#X connect 29 0 2 0;
#X connect 32 0 2 0;
#X connect 33 0 2 0;
#X connect 38 0 37 0;
#X connect 39 0 2 0;
#X connect 40 0 37 0;
#X connect 45 0 2 0;
#X restore 393 227 pd shapes;
#X obj 17 663 of.path, f 18;
#X msg 201 621 clear \, fillcolor 255 140 200 100 \, circle \$1 0 30
\, close \, arc 0 0 0 100 100 90 270;
#X floatatom 201 593 5 0 0 0 - - -;
#X text 293 505 :getMode \, getWindingMode \, getFillColor \, getStrokeColor
\, getStrokeWidth \, getCurveResolution \, getCircleResolution \, hasOutline
\, isFilled \, getOutline \, getTessellation;
#X msg 88 628 polywinding \$1;
#X obj 88 607 hradio 15 1 0 5 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X text 204 412 0 = WINDING_ODD \; 1 = WINDING_NONZERO \; 2 = WINDING_POSITIVE
\; 3 = WINDING_NEGATIVE \; 4 = WINDING_ABS_GEQ_TWO;
#X msg 34 607 clear;
#X connect 1 0 3 0;
#X connect 3 0 16 0;
#X connect 4 0 3 2;
#X connect 5 0 16 0;
#X connect 8 0 5 0;
#X connect 11 0 16 0;
#X connect 12 0 11 0;
#X connect 13 0 16 0;
#X connect 14 0 16 0;
#X connect 16 0 37 0;
#X connect 17 0 16 0;
#X connect 21 0 16 0;
#X connect 22 0 16 0;
#X connect 23 0 16 0;
#X connect 24 0 16 0;
#X connect 27 0 16 0;
#X connect 28 0 16 0;
#X connect 30 0 16 0;
#X connect 33 0 32 0;
#X connect 38 0 37 0;
#X connect 39 0 38 0;
#X connect 41 0 37 0;
#X connect 42 0 41 0;
#X connect 44 0 37 0;