p5 2.2.1-rc.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessibility/color_namer.js +5 -6
- package/dist/accessibility/describe.js +4 -26
- package/dist/accessibility/index.js +5 -6
- package/dist/accessibility/outputs.js +6 -38
- package/dist/app.js +5 -6
- package/dist/color/color_conversion.js +5 -6
- package/dist/color/creating_reading.js +1 -1
- package/dist/color/index.js +2 -2
- package/dist/color/p5.Color.js +1 -1
- package/dist/color/setting.js +59 -357
- package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +26 -158
- package/dist/core/filterShaders.js +1 -1
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/file_errors.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +1 -1
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +5 -6
- package/dist/core/internationalization.js +1 -1
- package/dist/core/legacy.js +5 -6
- package/dist/core/main.js +5 -6
- package/dist/core/p5.Graphics.js +4 -5
- package/dist/core/p5.Renderer.js +3 -4
- package/dist/core/p5.Renderer2D.js +5 -6
- package/dist/core/p5.Renderer3D.js +4 -5
- package/dist/core/rendering.js +4 -5
- package/dist/core/structure.js +13 -52
- package/dist/core/transform.js +32 -176
- package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
- package/dist/data/local_storage.js +4 -30
- package/dist/dom/dom.js +24 -159
- package/dist/dom/index.js +2 -2
- package/dist/dom/p5.Element.js +31 -208
- package/dist/dom/p5.File.js +1 -32
- package/dist/dom/p5.MediaElement.js +10 -113
- package/dist/events/acceleration.js +11 -64
- package/dist/events/keyboard.js +13 -81
- package/dist/events/pointer.js +18 -160
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +4 -5
- package/dist/image/image.js +4 -5
- package/dist/image/index.js +4 -5
- package/dist/image/loading_displaying.js +4 -5
- package/dist/image/p5.Image.js +3 -4
- package/dist/image/pixels.js +17 -100
- package/dist/io/files.js +4 -5
- package/dist/io/index.js +4 -5
- package/dist/io/p5.Table.js +66 -158
- package/dist/io/p5.TableRow.js +48 -71
- package/dist/io/p5.XML.js +6 -99
- package/dist/io/utilities.js +8 -3
- package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
- package/dist/math/Matrices/Matrix.js +87 -126
- package/dist/math/Matrices/MatrixNumjs.js +1 -5
- package/dist/math/calculation.js +10 -112
- package/dist/math/index.js +1 -1
- package/dist/math/math.js +2 -12
- package/dist/math/noise.js +5 -32
- package/dist/math/p5.Matrix.js +3 -3
- package/dist/math/p5.Vector.js +104 -345
- package/dist/math/random.js +5 -32
- package/dist/math/trigonometry.js +15 -105
- package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
- package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
- package/dist/shape/2d_primitives.js +33 -194
- package/dist/shape/attributes.js +12 -73
- package/dist/shape/curves.js +30 -95
- package/dist/shape/custom_shapes.js +63 -144
- package/dist/shape/index.js +2 -2
- package/dist/shape/vertex.js +21 -106
- package/dist/strands/p5.strands.js +248 -46
- package/dist/type/index.js +3 -4
- package/dist/type/p5.Font.js +4 -49
- package/dist/type/textCore.js +5 -158
- package/dist/utilities/conversion.js +17 -104
- package/dist/utilities/time_date.js +3 -40
- package/dist/utilities/utility_functions.js +6 -48
- package/dist/webgl/3d_primitives.js +4 -5
- package/dist/webgl/GeometryBuilder.js +1 -2
- package/dist/webgl/ShapeBuilder.js +22 -2
- package/dist/webgl/enums.js +1 -1
- package/dist/webgl/index.js +4 -5
- package/dist/webgl/interaction.js +6 -33
- package/dist/webgl/light.js +4 -5
- package/dist/webgl/loading.js +12 -46
- package/dist/webgl/material.js +4 -5
- package/dist/webgl/p5.Camera.js +4 -5
- package/dist/webgl/p5.DataArray.js +0 -4
- package/dist/webgl/p5.Framebuffer.js +4 -5
- package/dist/webgl/p5.Geometry.js +12 -106
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +7 -18
- package/dist/webgl/p5.Shader.js +12 -36
- package/dist/webgl/p5.Texture.js +4 -5
- package/dist/webgl/text.js +4 -5
- package/dist/webgl/utils.js +4 -5
- package/dist/webgpu/index.js +1 -1
- package/dist/webgpu/p5.RendererWebGPU.js +529 -208
- package/dist/webgpu/shaders/color.js +32 -17
- package/dist/webgpu/shaders/filters/base.js +18 -7
- package/dist/webgpu/shaders/font.js +52 -40
- package/dist/webgpu/shaders/line.js +50 -36
- package/dist/webgpu/shaders/material.js +90 -83
- package/dist/webgpu/strands_wgslBackend.js +5 -2
- package/lib/p5.esm.js +5576 -7811
- package/lib/p5.esm.min.js +1 -1
- package/lib/p5.js +5576 -7811
- package/lib/p5.min.js +1 -1
- package/lib/p5.webgpu.esm.js +786 -453
- package/lib/p5.webgpu.js +786 -453
- package/lib/p5.webgpu.min.js +1 -1
- package/package.json +13 -13
- package/types/global.d.ts +16905 -16783
- package/types/p5.d.ts +11142 -11081
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as CORNER, q as TWO_PI, r as HALF_PI, s as PI } from '../constants-
|
|
1
|
+
import { p as CORNER, q as TWO_PI, r as HALF_PI, s as PI } from '../constants-DQyACdzq.js';
|
|
2
2
|
import canvas from '../core/helpers.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -133,8 +133,6 @@ function primitives(p5, fn){
|
|
|
133
133
|
* @chainable
|
|
134
134
|
*
|
|
135
135
|
* @example
|
|
136
|
-
* <div>
|
|
137
|
-
* <code>
|
|
138
136
|
* function setup() {
|
|
139
137
|
* createCanvas(100, 100);
|
|
140
138
|
*
|
|
@@ -144,12 +142,8 @@ function primitives(p5, fn){
|
|
|
144
142
|
*
|
|
145
143
|
* describe('A white circle on a gray canvas. The top-right quarter of the circle is missing.');
|
|
146
144
|
* }
|
|
147
|
-
* </code>
|
|
148
|
-
* </div>
|
|
149
145
|
*
|
|
150
146
|
* @example
|
|
151
|
-
* <div>
|
|
152
|
-
* <code>
|
|
153
147
|
* function setup() {
|
|
154
148
|
* createCanvas(100, 100);
|
|
155
149
|
*
|
|
@@ -159,12 +153,8 @@ function primitives(p5, fn){
|
|
|
159
153
|
*
|
|
160
154
|
* describe('A white ellipse on a gray canvas. The top-right quarter of the ellipse is missing.');
|
|
161
155
|
* }
|
|
162
|
-
* </code>
|
|
163
|
-
* </div>
|
|
164
156
|
*
|
|
165
157
|
* @example
|
|
166
|
-
* <div>
|
|
167
|
-
* <code>
|
|
168
158
|
* function setup() {
|
|
169
159
|
* createCanvas(100, 100);
|
|
170
160
|
*
|
|
@@ -188,11 +178,8 @@ function primitives(p5, fn){
|
|
|
188
178
|
* 'A shattered outline of an circle with a quarter of a white circle at the bottom-right.'
|
|
189
179
|
* );
|
|
190
180
|
* }
|
|
191
|
-
* </code>
|
|
192
|
-
* </div>
|
|
193
181
|
*
|
|
194
|
-
*
|
|
195
|
-
* <code>
|
|
182
|
+
* @example
|
|
196
183
|
* function setup() {
|
|
197
184
|
* createCanvas(100, 100);
|
|
198
185
|
*
|
|
@@ -203,11 +190,8 @@ function primitives(p5, fn){
|
|
|
203
190
|
*
|
|
204
191
|
* describe('A white circle with the top-right third missing. The bottom is outlined in black.');
|
|
205
192
|
* }
|
|
206
|
-
* </code>
|
|
207
|
-
* </div>
|
|
208
193
|
*
|
|
209
|
-
*
|
|
210
|
-
* <code>
|
|
194
|
+
* @example
|
|
211
195
|
* function setup() {
|
|
212
196
|
* createCanvas(100, 100);
|
|
213
197
|
*
|
|
@@ -220,11 +204,8 @@ function primitives(p5, fn){
|
|
|
220
204
|
* 'A white circle missing a section from the top-right. The bottom is outlined in black.'
|
|
221
205
|
* );
|
|
222
206
|
* }
|
|
223
|
-
* </code>
|
|
224
|
-
* </div>
|
|
225
207
|
*
|
|
226
|
-
*
|
|
227
|
-
* <code>
|
|
208
|
+
* @example
|
|
228
209
|
* function setup() {
|
|
229
210
|
* createCanvas(100, 100);
|
|
230
211
|
*
|
|
@@ -235,11 +216,8 @@ function primitives(p5, fn){
|
|
|
235
216
|
*
|
|
236
217
|
* describe('A white circle with a black outline missing a section from the top-right.');
|
|
237
218
|
* }
|
|
238
|
-
* </code>
|
|
239
|
-
* </div>
|
|
240
219
|
*
|
|
241
|
-
*
|
|
242
|
-
* <code>
|
|
220
|
+
* @example
|
|
243
221
|
* function setup() {
|
|
244
222
|
* createCanvas(100, 100);
|
|
245
223
|
*
|
|
@@ -250,11 +228,8 @@ function primitives(p5, fn){
|
|
|
250
228
|
*
|
|
251
229
|
* describe('A white circle with a black outline. The top-right third is missing.');
|
|
252
230
|
* }
|
|
253
|
-
* </code>
|
|
254
|
-
* </div>
|
|
255
231
|
*
|
|
256
|
-
*
|
|
257
|
-
* <code>
|
|
232
|
+
* @example
|
|
258
233
|
* function setup() {
|
|
259
234
|
* createCanvas(100, 100, WEBGL);
|
|
260
235
|
*
|
|
@@ -265,11 +240,8 @@ function primitives(p5, fn){
|
|
|
265
240
|
*
|
|
266
241
|
* describe('A white circle with a black outline. The top-right third is missing.');
|
|
267
242
|
* }
|
|
268
|
-
* </code>
|
|
269
|
-
* </div>
|
|
270
243
|
*
|
|
271
|
-
*
|
|
272
|
-
* <code>
|
|
244
|
+
* @example
|
|
273
245
|
* function setup() {
|
|
274
246
|
* createCanvas(100, 100, WEBGL);
|
|
275
247
|
*
|
|
@@ -280,11 +252,8 @@ function primitives(p5, fn){
|
|
|
280
252
|
*
|
|
281
253
|
* describe('A white circle with a black outline. The top-right third is missing.');
|
|
282
254
|
* }
|
|
283
|
-
* </code>
|
|
284
|
-
* </div>
|
|
285
255
|
*
|
|
286
|
-
*
|
|
287
|
-
* <code>
|
|
256
|
+
* @example
|
|
288
257
|
* function setup() {
|
|
289
258
|
* createCanvas(100, 100);
|
|
290
259
|
*
|
|
@@ -306,8 +275,6 @@ function primitives(p5, fn){
|
|
|
306
275
|
* // Draw the arc.
|
|
307
276
|
* arc(50, 50, 80, 80, startAngle, endAngle, PIE);
|
|
308
277
|
* }
|
|
309
|
-
* </code>
|
|
310
|
-
* </div>
|
|
311
278
|
*/
|
|
312
279
|
fn.arc = function(x, y, w, h, start, stop, mode, detail) {
|
|
313
280
|
// this.validate("p5.arc", arguments);
|
|
@@ -397,8 +364,6 @@ function primitives(p5, fn){
|
|
|
397
364
|
* @chainable
|
|
398
365
|
*
|
|
399
366
|
* @example
|
|
400
|
-
* <div>
|
|
401
|
-
* <code>
|
|
402
367
|
* function setup() {
|
|
403
368
|
* createCanvas(100, 100);
|
|
404
369
|
*
|
|
@@ -408,12 +373,8 @@ function primitives(p5, fn){
|
|
|
408
373
|
*
|
|
409
374
|
* describe('A white circle on a gray canvas.');
|
|
410
375
|
* }
|
|
411
|
-
* </code>
|
|
412
|
-
* </div>
|
|
413
376
|
*
|
|
414
377
|
* @example
|
|
415
|
-
* <div>
|
|
416
|
-
* <code>
|
|
417
378
|
* function setup() {
|
|
418
379
|
* createCanvas(100, 100);
|
|
419
380
|
*
|
|
@@ -423,12 +384,8 @@ function primitives(p5, fn){
|
|
|
423
384
|
*
|
|
424
385
|
* describe('A white circle on a gray canvas.');
|
|
425
386
|
* }
|
|
426
|
-
* </code>
|
|
427
|
-
* </div>
|
|
428
387
|
*
|
|
429
388
|
* @example
|
|
430
|
-
* <div>
|
|
431
|
-
* <code>
|
|
432
389
|
* function setup() {
|
|
433
390
|
* createCanvas(100, 100);
|
|
434
391
|
*
|
|
@@ -438,12 +395,8 @@ function primitives(p5, fn){
|
|
|
438
395
|
*
|
|
439
396
|
* describe('A white ellipse on a gray canvas.');
|
|
440
397
|
* }
|
|
441
|
-
* </code>
|
|
442
|
-
* </div>
|
|
443
398
|
*
|
|
444
399
|
* @example
|
|
445
|
-
* <div>
|
|
446
|
-
* <code>
|
|
447
400
|
* function setup() {
|
|
448
401
|
* createCanvas(100, 100, WEBGL);
|
|
449
402
|
*
|
|
@@ -453,12 +406,8 @@ function primitives(p5, fn){
|
|
|
453
406
|
*
|
|
454
407
|
* describe('A white ellipse on a gray canvas.');
|
|
455
408
|
* }
|
|
456
|
-
* </code>
|
|
457
|
-
* </div>
|
|
458
409
|
*
|
|
459
410
|
* @example
|
|
460
|
-
* <div>
|
|
461
|
-
* <code>
|
|
462
411
|
* function setup() {
|
|
463
412
|
* createCanvas(100, 100, WEBGL);
|
|
464
413
|
*
|
|
@@ -469,10 +418,7 @@ function primitives(p5, fn){
|
|
|
469
418
|
*
|
|
470
419
|
* describe('A white hexagon on a gray canvas.');
|
|
471
420
|
* }
|
|
472
|
-
* </code>
|
|
473
|
-
* </div>
|
|
474
421
|
*/
|
|
475
|
-
|
|
476
422
|
/**
|
|
477
423
|
* @method ellipse
|
|
478
424
|
* @param {Number} x
|
|
@@ -505,8 +451,6 @@ function primitives(p5, fn){
|
|
|
505
451
|
* @chainable
|
|
506
452
|
*
|
|
507
453
|
* @example
|
|
508
|
-
* <div>
|
|
509
|
-
* <code>
|
|
510
454
|
* function setup() {
|
|
511
455
|
* createCanvas(100, 100);
|
|
512
456
|
*
|
|
@@ -516,12 +460,8 @@ function primitives(p5, fn){
|
|
|
516
460
|
*
|
|
517
461
|
* describe('A white circle with black outline in the middle of a gray canvas.');
|
|
518
462
|
* }
|
|
519
|
-
* </code>
|
|
520
|
-
* </div>
|
|
521
463
|
*
|
|
522
464
|
* @example
|
|
523
|
-
* <div>
|
|
524
|
-
* <code>
|
|
525
465
|
* function setup() {
|
|
526
466
|
* createCanvas(100, 100, WEBGL);
|
|
527
467
|
*
|
|
@@ -531,8 +471,6 @@ function primitives(p5, fn){
|
|
|
531
471
|
*
|
|
532
472
|
* describe('A white circle with black outline in the middle of a gray canvas.');
|
|
533
473
|
* }
|
|
534
|
-
* </code>
|
|
535
|
-
* </div>
|
|
536
474
|
*/
|
|
537
475
|
fn.circle = function(...args) {
|
|
538
476
|
// p5._validateParameters('circle', args);
|
|
@@ -594,8 +532,6 @@ function primitives(p5, fn){
|
|
|
594
532
|
* @chainable
|
|
595
533
|
*
|
|
596
534
|
* @example
|
|
597
|
-
* <div>
|
|
598
|
-
* <code>
|
|
599
535
|
* function setup() {
|
|
600
536
|
* createCanvas(100, 100);
|
|
601
537
|
*
|
|
@@ -607,12 +543,8 @@ function primitives(p5, fn){
|
|
|
607
543
|
* 'A black line on a gray canvas running from top-center to bottom-right.'
|
|
608
544
|
* );
|
|
609
545
|
* }
|
|
610
|
-
* </code>
|
|
611
|
-
* </div>
|
|
612
546
|
*
|
|
613
547
|
* @example
|
|
614
|
-
* <div>
|
|
615
|
-
* <code>
|
|
616
548
|
* function setup() {
|
|
617
549
|
* createCanvas(100, 100);
|
|
618
550
|
*
|
|
@@ -628,11 +560,8 @@ function primitives(p5, fn){
|
|
|
628
560
|
* 'A thick, magenta line on a gray canvas running from top-center to bottom-right.'
|
|
629
561
|
* );
|
|
630
562
|
* }
|
|
631
|
-
* </code>
|
|
632
|
-
* </div>
|
|
633
563
|
*
|
|
634
|
-
*
|
|
635
|
-
* <code>
|
|
564
|
+
* @example
|
|
636
565
|
* function setup() {
|
|
637
566
|
* createCanvas(100, 100);
|
|
638
567
|
*
|
|
@@ -653,12 +582,8 @@ function primitives(p5, fn){
|
|
|
653
582
|
* 'Three lines drawn in grayscale on a gray canvas. They form the top, right, and bottom sides of a square.'
|
|
654
583
|
* );
|
|
655
584
|
* }
|
|
656
|
-
* </code>
|
|
657
|
-
* </div>
|
|
658
585
|
*
|
|
659
586
|
* @example
|
|
660
|
-
* <div>
|
|
661
|
-
* <code>
|
|
662
587
|
* function setup() {
|
|
663
588
|
* createCanvas(100, 100, WEBGL);
|
|
664
589
|
*
|
|
@@ -670,11 +595,8 @@ function primitives(p5, fn){
|
|
|
670
595
|
* 'A black line on a gray canvas running from top-center to bottom-right.'
|
|
671
596
|
* );
|
|
672
597
|
* }
|
|
673
|
-
* </code>
|
|
674
|
-
* </div>
|
|
675
598
|
*
|
|
676
|
-
*
|
|
677
|
-
* <code>
|
|
599
|
+
* @example
|
|
678
600
|
* function setup() {
|
|
679
601
|
* createCanvas(100, 100, WEBGL);
|
|
680
602
|
*
|
|
@@ -699,9 +621,6 @@ function primitives(p5, fn){
|
|
|
699
621
|
* // Draw the bottom-right sphere.
|
|
700
622
|
* sphere(10);
|
|
701
623
|
* }
|
|
702
|
-
* </code>
|
|
703
|
-
* </div>
|
|
704
|
-
*
|
|
705
624
|
*/
|
|
706
625
|
|
|
707
626
|
/**
|
|
@@ -755,16 +674,14 @@ function primitives(p5, fn){
|
|
|
755
674
|
* @param {Number} [z] the z-coordinate (for WebGL mode).
|
|
756
675
|
* @chainable
|
|
757
676
|
* @example
|
|
758
|
-
* <div>
|
|
759
|
-
* <code>
|
|
760
677
|
* function setup() {
|
|
761
678
|
* createCanvas(100, 100);
|
|
762
679
|
*
|
|
763
680
|
* background(200);
|
|
764
|
-
*
|
|
681
|
+
*
|
|
765
682
|
* // Making point to 5 pixels
|
|
766
683
|
* strokeWeight(5);
|
|
767
|
-
*
|
|
684
|
+
*
|
|
768
685
|
* // Top-left.
|
|
769
686
|
* point(30, 20);
|
|
770
687
|
*
|
|
@@ -781,16 +698,13 @@ function primitives(p5, fn){
|
|
|
781
698
|
* 'Four small, black points drawn on a gray canvas. The points form the corners of a square.'
|
|
782
699
|
* );
|
|
783
700
|
* }
|
|
784
|
-
* </code>
|
|
785
|
-
* </div>
|
|
786
701
|
*
|
|
787
|
-
*
|
|
788
|
-
* <code>
|
|
702
|
+
* @example
|
|
789
703
|
* function setup() {
|
|
790
704
|
* createCanvas(100, 100);
|
|
791
705
|
*
|
|
792
706
|
* background(200);
|
|
793
|
-
*
|
|
707
|
+
*
|
|
794
708
|
* // Making point to 5 pixels.
|
|
795
709
|
* strokeWeight(5);
|
|
796
710
|
*
|
|
@@ -814,11 +728,8 @@ function primitives(p5, fn){
|
|
|
814
728
|
* 'Four points drawn on a gray canvas. Two are black and two are purple. The points form the corners of a square.'
|
|
815
729
|
* );
|
|
816
730
|
* }
|
|
817
|
-
* </code>
|
|
818
|
-
* </div>
|
|
819
731
|
*
|
|
820
|
-
*
|
|
821
|
-
* <code>
|
|
732
|
+
* @example
|
|
822
733
|
* function setup() {
|
|
823
734
|
* createCanvas(100, 100);
|
|
824
735
|
*
|
|
@@ -847,11 +758,8 @@ function primitives(p5, fn){
|
|
|
847
758
|
* 'Four small, black points drawn on a gray canvas. The points form the corners of a square.'
|
|
848
759
|
* );
|
|
849
760
|
* }
|
|
850
|
-
* </code>
|
|
851
|
-
* </div>
|
|
852
761
|
*
|
|
853
|
-
*
|
|
854
|
-
* <code>
|
|
762
|
+
* @example
|
|
855
763
|
* function setup() {
|
|
856
764
|
* createCanvas(100, 100, WEBGL);
|
|
857
765
|
*
|
|
@@ -871,11 +779,8 @@ function primitives(p5, fn){
|
|
|
871
779
|
* // Bottom-right.
|
|
872
780
|
* point(20, 30);
|
|
873
781
|
* }
|
|
874
|
-
* </code>
|
|
875
|
-
* </div>
|
|
876
782
|
*
|
|
877
|
-
*
|
|
878
|
-
* <code>
|
|
783
|
+
* @example
|
|
879
784
|
* function setup() {
|
|
880
785
|
* createCanvas(100, 100, WEBGL);
|
|
881
786
|
*
|
|
@@ -898,8 +803,6 @@ function primitives(p5, fn){
|
|
|
898
803
|
* // Bottom-right.
|
|
899
804
|
* point(20, 30, -50);
|
|
900
805
|
* }
|
|
901
|
-
* </code>
|
|
902
|
-
* </div>
|
|
903
806
|
*/
|
|
904
807
|
|
|
905
808
|
/**
|
|
@@ -960,8 +863,6 @@ function primitives(p5, fn){
|
|
|
960
863
|
* @param {Integer} [detailY] number of segments in the y-direction.
|
|
961
864
|
* @chainable
|
|
962
865
|
* @example
|
|
963
|
-
* <div>
|
|
964
|
-
* <code>
|
|
965
866
|
* function setup() {
|
|
966
867
|
* createCanvas(100, 100);
|
|
967
868
|
*
|
|
@@ -971,11 +872,8 @@ function primitives(p5, fn){
|
|
|
971
872
|
*
|
|
972
873
|
* describe('A white square with a black outline drawn on a gray canvas.');
|
|
973
874
|
* }
|
|
974
|
-
* </code>
|
|
975
|
-
* </div>
|
|
976
875
|
*
|
|
977
|
-
*
|
|
978
|
-
* <code>
|
|
876
|
+
* @example
|
|
979
877
|
* function setup() {
|
|
980
878
|
* createCanvas(100, 100);
|
|
981
879
|
*
|
|
@@ -985,11 +883,8 @@ function primitives(p5, fn){
|
|
|
985
883
|
*
|
|
986
884
|
* describe('A white rectangle with a black outline drawn on a gray canvas.');
|
|
987
885
|
* }
|
|
988
|
-
* </code>
|
|
989
|
-
* </div>
|
|
990
886
|
*
|
|
991
|
-
*
|
|
992
|
-
* <code>
|
|
887
|
+
* @example
|
|
993
888
|
* function setup() {
|
|
994
889
|
* createCanvas(100, 100);
|
|
995
890
|
*
|
|
@@ -999,11 +894,8 @@ function primitives(p5, fn){
|
|
|
999
894
|
*
|
|
1000
895
|
* describe('A white rhombus with a black outline drawn on a gray canvas.');
|
|
1001
896
|
* }
|
|
1002
|
-
* </code>
|
|
1003
|
-
* </div>
|
|
1004
897
|
*
|
|
1005
|
-
*
|
|
1006
|
-
* <code>
|
|
898
|
+
* @example
|
|
1007
899
|
* function setup() {
|
|
1008
900
|
* createCanvas(100, 100);
|
|
1009
901
|
*
|
|
@@ -1013,11 +905,8 @@ function primitives(p5, fn){
|
|
|
1013
905
|
*
|
|
1014
906
|
* describe('A white trapezoid with a black outline drawn on a gray canvas.');
|
|
1015
907
|
* }
|
|
1016
|
-
* </code>
|
|
1017
|
-
* </div>
|
|
1018
908
|
*
|
|
1019
|
-
*
|
|
1020
|
-
* <code>
|
|
909
|
+
* @example
|
|
1021
910
|
* function setup() {
|
|
1022
911
|
* createCanvas(100, 100, WEBGL);
|
|
1023
912
|
*
|
|
@@ -1027,11 +916,8 @@ function primitives(p5, fn){
|
|
|
1027
916
|
*
|
|
1028
917
|
* describe('A white square with a black outline drawn on a gray canvas.');
|
|
1029
918
|
* }
|
|
1030
|
-
* </code>
|
|
1031
|
-
* </div>
|
|
1032
919
|
*
|
|
1033
|
-
*
|
|
1034
|
-
* <code>
|
|
920
|
+
* @example
|
|
1035
921
|
* function setup() {
|
|
1036
922
|
* createCanvas(100, 100, WEBGL);
|
|
1037
923
|
*
|
|
@@ -1047,8 +933,6 @@ function primitives(p5, fn){
|
|
|
1047
933
|
* // Draw the quad.
|
|
1048
934
|
* quad(-30, -30, 0, 30, -30, 0, 30, 30, 20, -30, 30, -20);
|
|
1049
935
|
* }
|
|
1050
|
-
* </code>
|
|
1051
|
-
* </div>
|
|
1052
936
|
*/
|
|
1053
937
|
/**
|
|
1054
938
|
* @method quad
|
|
@@ -1123,8 +1007,6 @@ function primitives(p5, fn){
|
|
|
1123
1007
|
* @chainable
|
|
1124
1008
|
*
|
|
1125
1009
|
* @example
|
|
1126
|
-
* <div>
|
|
1127
|
-
* <code>
|
|
1128
1010
|
* function setup() {
|
|
1129
1011
|
* createCanvas(100, 100);
|
|
1130
1012
|
*
|
|
@@ -1134,11 +1016,8 @@ function primitives(p5, fn){
|
|
|
1134
1016
|
*
|
|
1135
1017
|
* describe('A white square with a black outline on a gray canvas.');
|
|
1136
1018
|
* }
|
|
1137
|
-
* </code>
|
|
1138
|
-
* </div>
|
|
1139
1019
|
*
|
|
1140
|
-
*
|
|
1141
|
-
* <code>
|
|
1020
|
+
* @example
|
|
1142
1021
|
* function setup() {
|
|
1143
1022
|
* createCanvas(100, 100);
|
|
1144
1023
|
*
|
|
@@ -1148,11 +1027,8 @@ function primitives(p5, fn){
|
|
|
1148
1027
|
*
|
|
1149
1028
|
* describe('A white rectangle with a black outline on a gray canvas.');
|
|
1150
1029
|
* }
|
|
1151
|
-
* </code>
|
|
1152
|
-
* </div>
|
|
1153
1030
|
*
|
|
1154
|
-
*
|
|
1155
|
-
* <code>
|
|
1031
|
+
* @example
|
|
1156
1032
|
* function setup() {
|
|
1157
1033
|
* createCanvas(100, 100);
|
|
1158
1034
|
*
|
|
@@ -1163,11 +1039,8 @@ function primitives(p5, fn){
|
|
|
1163
1039
|
*
|
|
1164
1040
|
* describe('A white rectangle with a black outline and round edges on a gray canvas.');
|
|
1165
1041
|
* }
|
|
1166
|
-
* </code>
|
|
1167
|
-
* </div>
|
|
1168
1042
|
*
|
|
1169
|
-
*
|
|
1170
|
-
* <code>
|
|
1043
|
+
* @example
|
|
1171
1044
|
* function setup() {
|
|
1172
1045
|
* createCanvas(100, 100);
|
|
1173
1046
|
*
|
|
@@ -1178,11 +1051,8 @@ function primitives(p5, fn){
|
|
|
1178
1051
|
*
|
|
1179
1052
|
* describe('A white rectangle with a black outline and round edges of different radii.');
|
|
1180
1053
|
* }
|
|
1181
|
-
* </code>
|
|
1182
|
-
* </div>
|
|
1183
1054
|
*
|
|
1184
|
-
*
|
|
1185
|
-
* <code>
|
|
1055
|
+
* @example
|
|
1186
1056
|
* function setup() {
|
|
1187
1057
|
* createCanvas(100, 100, WEBGL);
|
|
1188
1058
|
*
|
|
@@ -1192,11 +1062,8 @@ function primitives(p5, fn){
|
|
|
1192
1062
|
*
|
|
1193
1063
|
* describe('A white square with a black outline on a gray canvas.');
|
|
1194
1064
|
* }
|
|
1195
|
-
* </code>
|
|
1196
|
-
* </div>
|
|
1197
1065
|
*
|
|
1198
|
-
*
|
|
1199
|
-
* <code>
|
|
1066
|
+
* @example
|
|
1200
1067
|
* function setup() {
|
|
1201
1068
|
* createCanvas(100, 100, WEBGL);
|
|
1202
1069
|
*
|
|
@@ -1212,8 +1079,6 @@ function primitives(p5, fn){
|
|
|
1212
1079
|
* // Draw the rectangle.
|
|
1213
1080
|
* rect(-20, -30, 55, 55);
|
|
1214
1081
|
* }
|
|
1215
|
-
* </code>
|
|
1216
|
-
* </div>
|
|
1217
1082
|
*/
|
|
1218
1083
|
|
|
1219
1084
|
/**
|
|
@@ -1260,8 +1125,6 @@ function primitives(p5, fn){
|
|
|
1260
1125
|
* @chainable
|
|
1261
1126
|
*
|
|
1262
1127
|
* @example
|
|
1263
|
-
* <div>
|
|
1264
|
-
* <code>
|
|
1265
1128
|
* function setup() {
|
|
1266
1129
|
* createCanvas(100, 100);
|
|
1267
1130
|
*
|
|
@@ -1271,11 +1134,8 @@ function primitives(p5, fn){
|
|
|
1271
1134
|
*
|
|
1272
1135
|
* describe('A white square with a black outline in on a gray canvas.');
|
|
1273
1136
|
* }
|
|
1274
|
-
* </code>
|
|
1275
|
-
* </div>
|
|
1276
1137
|
*
|
|
1277
|
-
*
|
|
1278
|
-
* <code>
|
|
1138
|
+
* @example
|
|
1279
1139
|
* function setup() {
|
|
1280
1140
|
* createCanvas(100, 100);
|
|
1281
1141
|
*
|
|
@@ -1288,11 +1148,8 @@ function primitives(p5, fn){
|
|
|
1288
1148
|
* 'A white square with a black outline and round edges on a gray canvas.'
|
|
1289
1149
|
* );
|
|
1290
1150
|
* }
|
|
1291
|
-
* </code>
|
|
1292
|
-
* </div>
|
|
1293
1151
|
*
|
|
1294
|
-
*
|
|
1295
|
-
* <code>
|
|
1152
|
+
* @example
|
|
1296
1153
|
* function setup() {
|
|
1297
1154
|
* createCanvas(100, 100);
|
|
1298
1155
|
*
|
|
@@ -1303,11 +1160,8 @@ function primitives(p5, fn){
|
|
|
1303
1160
|
*
|
|
1304
1161
|
* describe('A white square with a black outline and round edges of different radii.');
|
|
1305
1162
|
* }
|
|
1306
|
-
* </code>
|
|
1307
|
-
* </div>
|
|
1308
1163
|
*
|
|
1309
|
-
*
|
|
1310
|
-
* <code>
|
|
1164
|
+
* @example
|
|
1311
1165
|
* function setup() {
|
|
1312
1166
|
* createCanvas(100, 100, WEBGL);
|
|
1313
1167
|
*
|
|
@@ -1317,11 +1171,8 @@ function primitives(p5, fn){
|
|
|
1317
1171
|
*
|
|
1318
1172
|
* describe('A white square with a black outline in on a gray canvas.');
|
|
1319
1173
|
* }
|
|
1320
|
-
* </code>
|
|
1321
|
-
* </div>
|
|
1322
1174
|
*
|
|
1323
|
-
*
|
|
1324
|
-
* <code>
|
|
1175
|
+
* @example
|
|
1325
1176
|
* function setup() {
|
|
1326
1177
|
* createCanvas(100, 100, WEBGL);
|
|
1327
1178
|
*
|
|
@@ -1337,8 +1188,6 @@ function primitives(p5, fn){
|
|
|
1337
1188
|
* // Draw the square.
|
|
1338
1189
|
* square(-20, -30, 55);
|
|
1339
1190
|
* }
|
|
1340
|
-
* </code>
|
|
1341
|
-
* </div>
|
|
1342
1191
|
*/
|
|
1343
1192
|
fn.square = function(x, y, s, tl, tr, br, bl) {
|
|
1344
1193
|
// p5._validateParameters('square', arguments);
|
|
@@ -1405,8 +1254,6 @@ function primitives(p5, fn){
|
|
|
1405
1254
|
* @chainable
|
|
1406
1255
|
*
|
|
1407
1256
|
* @example
|
|
1408
|
-
* <div>
|
|
1409
|
-
* <code>
|
|
1410
1257
|
* function setup() {
|
|
1411
1258
|
* createCanvas(100, 100);
|
|
1412
1259
|
*
|
|
@@ -1416,11 +1263,8 @@ function primitives(p5, fn){
|
|
|
1416
1263
|
*
|
|
1417
1264
|
* describe('A white triangle with a black outline on a gray canvas.');
|
|
1418
1265
|
* }
|
|
1419
|
-
* </code>
|
|
1420
|
-
* </div>
|
|
1421
1266
|
*
|
|
1422
|
-
*
|
|
1423
|
-
* <code>
|
|
1267
|
+
* @example
|
|
1424
1268
|
* function setup() {
|
|
1425
1269
|
* createCanvas(100, 100, WEBGL);
|
|
1426
1270
|
*
|
|
@@ -1430,11 +1274,8 @@ function primitives(p5, fn){
|
|
|
1430
1274
|
*
|
|
1431
1275
|
* describe('A white triangle with a black outline on a gray canvas.');
|
|
1432
1276
|
* }
|
|
1433
|
-
* </code>
|
|
1434
|
-
* </div>
|
|
1435
1277
|
*
|
|
1436
|
-
*
|
|
1437
|
-
* <code>
|
|
1278
|
+
* @example
|
|
1438
1279
|
* function setup() {
|
|
1439
1280
|
* createCanvas(100, 100, WEBGL);
|
|
1440
1281
|
*
|
|
@@ -1450,8 +1291,6 @@ function primitives(p5, fn){
|
|
|
1450
1291
|
* // Draw the triangle.
|
|
1451
1292
|
* triangle(-20, 25, 8, -30, 36, 25);
|
|
1452
1293
|
* }
|
|
1453
|
-
* </code>
|
|
1454
|
-
* </div>
|
|
1455
1294
|
*/
|
|
1456
1295
|
fn.triangle = function(...args) {
|
|
1457
1296
|
// p5._validateParameters('triangle', args);
|