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
package/dist/shape/vertex.js
CHANGED
|
@@ -48,8 +48,6 @@ function vertex(p5, fn){
|
|
|
48
48
|
* @chainable
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
|
-
* <div>
|
|
52
|
-
* <code>
|
|
53
51
|
* function setup() {
|
|
54
52
|
* createCanvas(100, 100);
|
|
55
53
|
*
|
|
@@ -69,11 +67,8 @@ function vertex(p5, fn){
|
|
|
69
67
|
*
|
|
70
68
|
* describe('A white square on a gray background.');
|
|
71
69
|
* }
|
|
72
|
-
* </code>
|
|
73
|
-
* </div>
|
|
74
70
|
*
|
|
75
|
-
*
|
|
76
|
-
* <code>
|
|
71
|
+
* @example
|
|
77
72
|
* function setup() {
|
|
78
73
|
* createCanvas(100, 100);
|
|
79
74
|
*
|
|
@@ -94,11 +89,8 @@ function vertex(p5, fn){
|
|
|
94
89
|
*
|
|
95
90
|
* describe('Four black dots that form a square are drawn on a gray background.');
|
|
96
91
|
* }
|
|
97
|
-
* </code>
|
|
98
|
-
* </div>
|
|
99
92
|
*
|
|
100
|
-
*
|
|
101
|
-
* <code>
|
|
93
|
+
* @example
|
|
102
94
|
* function setup() {
|
|
103
95
|
* createCanvas(100, 100);
|
|
104
96
|
*
|
|
@@ -119,11 +111,8 @@ function vertex(p5, fn){
|
|
|
119
111
|
*
|
|
120
112
|
* describe('Two horizontal black lines on a gray background.');
|
|
121
113
|
* }
|
|
122
|
-
* </code>
|
|
123
|
-
* </div>
|
|
124
114
|
*
|
|
125
|
-
*
|
|
126
|
-
* <code>
|
|
115
|
+
* @example
|
|
127
116
|
* function setup() {
|
|
128
117
|
* createCanvas(100, 100);
|
|
129
118
|
*
|
|
@@ -146,11 +135,8 @@ function vertex(p5, fn){
|
|
|
146
135
|
*
|
|
147
136
|
* describe('Three black lines form a sideways U shape on a gray background.');
|
|
148
137
|
* }
|
|
149
|
-
* </code>
|
|
150
|
-
* </div>
|
|
151
138
|
*
|
|
152
|
-
*
|
|
153
|
-
* <code>
|
|
139
|
+
* @example
|
|
154
140
|
* function setup() {
|
|
155
141
|
* createCanvas(100, 100);
|
|
156
142
|
*
|
|
@@ -174,11 +160,8 @@ function vertex(p5, fn){
|
|
|
174
160
|
*
|
|
175
161
|
* describe('A black outline of a square drawn on a gray background.');
|
|
176
162
|
* }
|
|
177
|
-
* </code>
|
|
178
|
-
* </div>
|
|
179
163
|
*
|
|
180
|
-
*
|
|
181
|
-
* <code>
|
|
164
|
+
* @example
|
|
182
165
|
* function setup() {
|
|
183
166
|
* createCanvas(100, 100);
|
|
184
167
|
*
|
|
@@ -203,11 +186,8 @@ function vertex(p5, fn){
|
|
|
203
186
|
*
|
|
204
187
|
* describe('Two white triangles drawn on a gray background.');
|
|
205
188
|
* }
|
|
206
|
-
* </code>
|
|
207
|
-
* </div>
|
|
208
189
|
*
|
|
209
|
-
*
|
|
210
|
-
* <code>
|
|
190
|
+
* @example
|
|
211
191
|
* function setup() {
|
|
212
192
|
* createCanvas(100, 100);
|
|
213
193
|
*
|
|
@@ -231,11 +211,8 @@ function vertex(p5, fn){
|
|
|
231
211
|
*
|
|
232
212
|
* describe('Five white triangles that are interleaved drawn on a gray background.');
|
|
233
213
|
* }
|
|
234
|
-
* </code>
|
|
235
|
-
* </div>
|
|
236
214
|
*
|
|
237
|
-
*
|
|
238
|
-
* <code>
|
|
215
|
+
* @example
|
|
239
216
|
* function setup() {
|
|
240
217
|
* createCanvas(100, 100);
|
|
241
218
|
*
|
|
@@ -258,11 +235,8 @@ function vertex(p5, fn){
|
|
|
258
235
|
*
|
|
259
236
|
* describe('Four white triangles form a square are drawn on a gray background.');
|
|
260
237
|
* }
|
|
261
|
-
* </code>
|
|
262
|
-
* </div>
|
|
263
238
|
*
|
|
264
|
-
*
|
|
265
|
-
* <code>
|
|
239
|
+
* @example
|
|
266
240
|
* function setup() {
|
|
267
241
|
* createCanvas(100, 100);
|
|
268
242
|
*
|
|
@@ -289,11 +263,8 @@ function vertex(p5, fn){
|
|
|
289
263
|
*
|
|
290
264
|
* describe('Two white rectangles drawn on a gray background.');
|
|
291
265
|
* }
|
|
292
|
-
* </code>
|
|
293
|
-
* </div>
|
|
294
266
|
*
|
|
295
|
-
*
|
|
296
|
-
* <code>
|
|
267
|
+
* @example
|
|
297
268
|
* function setup() {
|
|
298
269
|
* createCanvas(100, 100);
|
|
299
270
|
*
|
|
@@ -318,11 +289,8 @@ function vertex(p5, fn){
|
|
|
318
289
|
*
|
|
319
290
|
* describe('Three white rectangles that share edges are drawn on a gray background.');
|
|
320
291
|
* }
|
|
321
|
-
* </code>
|
|
322
|
-
* </div>
|
|
323
292
|
*
|
|
324
|
-
*
|
|
325
|
-
* <code>
|
|
293
|
+
* @example
|
|
326
294
|
* function setup() {
|
|
327
295
|
* createCanvas(100, 100, WEBGL);
|
|
328
296
|
*
|
|
@@ -348,11 +316,8 @@ function vertex(p5, fn){
|
|
|
348
316
|
*
|
|
349
317
|
* describe('A blocky C shape drawn in white on a gray background.');
|
|
350
318
|
* }
|
|
351
|
-
* </code>
|
|
352
|
-
* </div>
|
|
353
319
|
*
|
|
354
|
-
*
|
|
355
|
-
* <code>
|
|
320
|
+
* @example
|
|
356
321
|
* // Click and drag with the mouse to view the scene from different angles.
|
|
357
322
|
*
|
|
358
323
|
* function setup() {
|
|
@@ -391,8 +356,6 @@ function vertex(p5, fn){
|
|
|
391
356
|
* // Connect the first and last vertices.
|
|
392
357
|
* endShape(CLOSE);
|
|
393
358
|
* }
|
|
394
|
-
* </code>
|
|
395
|
-
* </div>
|
|
396
359
|
*/
|
|
397
360
|
fn.beginShape = function(kind) {
|
|
398
361
|
// p5._validateParameters('beginShape', arguments);
|
|
@@ -435,8 +398,6 @@ function vertex(p5, fn){
|
|
|
435
398
|
* @param {Number} [v]
|
|
436
399
|
*
|
|
437
400
|
* @example
|
|
438
|
-
* <div>
|
|
439
|
-
* <code>
|
|
440
401
|
* function setup() {
|
|
441
402
|
* createCanvas(100, 100);
|
|
442
403
|
*
|
|
@@ -461,11 +422,8 @@ function vertex(p5, fn){
|
|
|
461
422
|
*
|
|
462
423
|
* describe('A black C curve on a gray background.');
|
|
463
424
|
* }
|
|
464
|
-
* </code>
|
|
465
|
-
* </div>
|
|
466
425
|
*
|
|
467
|
-
*
|
|
468
|
-
* <code>
|
|
426
|
+
* @example
|
|
469
427
|
* function setup() {
|
|
470
428
|
* createCanvas(100, 100);
|
|
471
429
|
*
|
|
@@ -510,11 +468,8 @@ function vertex(p5, fn){
|
|
|
510
468
|
* 'A gray square with three curves. A black curve has two straight, red lines that extend from its ends. The endpoints of all the curves are marked with dots.'
|
|
511
469
|
* );
|
|
512
470
|
* }
|
|
513
|
-
* </code>
|
|
514
|
-
* </div>
|
|
515
471
|
*
|
|
516
|
-
*
|
|
517
|
-
* <code>
|
|
472
|
+
* @example
|
|
518
473
|
* // Click the mouse near the red dot in the top-right corner
|
|
519
474
|
* // and drag to change the curve's shape.
|
|
520
475
|
*
|
|
@@ -588,11 +543,8 @@ function vertex(p5, fn){
|
|
|
588
543
|
* y2 = mouseY;
|
|
589
544
|
* }
|
|
590
545
|
* }
|
|
591
|
-
* </code>
|
|
592
|
-
* </div>
|
|
593
546
|
*
|
|
594
|
-
*
|
|
595
|
-
* <code>
|
|
547
|
+
* @example
|
|
596
548
|
* function setup() {
|
|
597
549
|
* createCanvas(100, 100);
|
|
598
550
|
*
|
|
@@ -618,11 +570,8 @@ function vertex(p5, fn){
|
|
|
618
570
|
*
|
|
619
571
|
* describe('A crescent moon shape drawn in white on a gray background.');
|
|
620
572
|
* }
|
|
621
|
-
* </code>
|
|
622
|
-
* </div>
|
|
623
573
|
*
|
|
624
|
-
*
|
|
625
|
-
* <code>
|
|
574
|
+
* @example
|
|
626
575
|
* // Click and drag the mouse to view the scene from different angles.
|
|
627
576
|
*
|
|
628
577
|
* function setup() {
|
|
@@ -669,10 +618,7 @@ function vertex(p5, fn){
|
|
|
669
618
|
*
|
|
670
619
|
* endShape();
|
|
671
620
|
* }
|
|
672
|
-
* </code>
|
|
673
|
-
* </div>
|
|
674
621
|
*/
|
|
675
|
-
|
|
676
622
|
/**
|
|
677
623
|
* @method bezierVertex
|
|
678
624
|
* @param {Number} x
|
|
@@ -729,8 +675,6 @@ function vertex(p5, fn){
|
|
|
729
675
|
* @chainable
|
|
730
676
|
*
|
|
731
677
|
* @example
|
|
732
|
-
* <div>
|
|
733
|
-
* <code>
|
|
734
678
|
* function setup() {
|
|
735
679
|
* createCanvas(100, 100);
|
|
736
680
|
*
|
|
@@ -757,11 +701,8 @@ function vertex(p5, fn){
|
|
|
757
701
|
* 'Two sets of black lines drawn on a gray background. The three lines on the left form a right triangle. The two lines on the right form a right angle.'
|
|
758
702
|
* );
|
|
759
703
|
* }
|
|
760
|
-
* </code>
|
|
761
|
-
* </div>
|
|
762
704
|
*
|
|
763
|
-
*
|
|
764
|
-
* <code>
|
|
705
|
+
* @example
|
|
765
706
|
* function setup() {
|
|
766
707
|
* createCanvas(200, 100);
|
|
767
708
|
*
|
|
@@ -788,11 +729,8 @@ function vertex(p5, fn){
|
|
|
788
729
|
* 'Two right-angled shapes on a light gray background. The left shape is open with three lines. The right shape is closed, forming a triangle.'
|
|
789
730
|
* );
|
|
790
731
|
* }
|
|
791
|
-
* </code>
|
|
792
|
-
* </div>
|
|
793
732
|
*
|
|
794
|
-
*
|
|
795
|
-
* <code>
|
|
733
|
+
* @example
|
|
796
734
|
* function setup() {
|
|
797
735
|
* createCanvas(100, 100);
|
|
798
736
|
* background(200);
|
|
@@ -810,11 +748,8 @@ function vertex(p5, fn){
|
|
|
810
748
|
* 'A curvy four-sided slightly lopsided blob.'
|
|
811
749
|
* );
|
|
812
750
|
* }
|
|
813
|
-
* </div>
|
|
814
|
-
* </code>
|
|
815
751
|
*
|
|
816
|
-
*
|
|
817
|
-
* <code>
|
|
752
|
+
* @example
|
|
818
753
|
* // Note: A "uniform" is a global variable within a shader program.
|
|
819
754
|
*
|
|
820
755
|
* // Create a string with the vertex shader program.
|
|
@@ -899,8 +834,6 @@ function vertex(p5, fn){
|
|
|
899
834
|
*
|
|
900
835
|
* describe('A row of four squares. Their colors transition from purple on the left to red on the right');
|
|
901
836
|
* }
|
|
902
|
-
* </code>
|
|
903
|
-
* </div>
|
|
904
837
|
*/
|
|
905
838
|
fn.endShape = function(mode, count = 1) {
|
|
906
839
|
// p5._validateParameters('endShape', arguments);
|
|
@@ -970,8 +903,6 @@ function vertex(p5, fn){
|
|
|
970
903
|
* @chainable
|
|
971
904
|
*
|
|
972
905
|
* @example
|
|
973
|
-
* <div>
|
|
974
|
-
* <code>
|
|
975
906
|
* // Click the and drag the mouse to view the scene from a different angle.
|
|
976
907
|
*
|
|
977
908
|
* function setup() {
|
|
@@ -1000,11 +931,8 @@ function vertex(p5, fn){
|
|
|
1000
931
|
* vertex(-30, 30, 0);
|
|
1001
932
|
* endShape();
|
|
1002
933
|
* }
|
|
1003
|
-
* </code>
|
|
1004
|
-
* </div>
|
|
1005
934
|
*
|
|
1006
|
-
*
|
|
1007
|
-
* <code>
|
|
935
|
+
* @example
|
|
1008
936
|
* // Click the and drag the mouse to view the scene from a different angle.
|
|
1009
937
|
*
|
|
1010
938
|
* function setup() {
|
|
@@ -1039,11 +967,8 @@ function vertex(p5, fn){
|
|
|
1039
967
|
* vertex(-30, 30, 0);
|
|
1040
968
|
* endShape();
|
|
1041
969
|
* }
|
|
1042
|
-
* </code>
|
|
1043
|
-
* </div>
|
|
1044
970
|
*
|
|
1045
|
-
*
|
|
1046
|
-
* <code>
|
|
971
|
+
* @example
|
|
1047
972
|
* // Click the and drag the mouse to view the scene from a different angle.
|
|
1048
973
|
*
|
|
1049
974
|
* function setup() {
|
|
@@ -1083,10 +1008,7 @@ function vertex(p5, fn){
|
|
|
1083
1008
|
* vertex(-30, 30, 0);
|
|
1084
1009
|
* endShape();
|
|
1085
1010
|
* }
|
|
1086
|
-
* </code>
|
|
1087
|
-
* </div>
|
|
1088
1011
|
*/
|
|
1089
|
-
|
|
1090
1012
|
/**
|
|
1091
1013
|
* @method normal
|
|
1092
1014
|
* @param {Number} x x-component of the vertex normal.
|
|
@@ -1131,8 +1053,6 @@ function vertex(p5, fn){
|
|
|
1131
1053
|
* @param {Number|Number[]} data the data tied to the vertex attribute.
|
|
1132
1054
|
*
|
|
1133
1055
|
* @example
|
|
1134
|
-
* <div>
|
|
1135
|
-
* <code>
|
|
1136
1056
|
* const vertSrc = `#version 300 es
|
|
1137
1057
|
* precision mediump float;
|
|
1138
1058
|
* uniform mat4 uModelViewMatrix;
|
|
@@ -1187,11 +1107,8 @@ function vertex(p5, fn){
|
|
|
1187
1107
|
* }
|
|
1188
1108
|
* endShape(CLOSE);
|
|
1189
1109
|
* }
|
|
1190
|
-
* </code>
|
|
1191
|
-
* </div>
|
|
1192
1110
|
*
|
|
1193
|
-
*
|
|
1194
|
-
* <code>
|
|
1111
|
+
* @example
|
|
1195
1112
|
* let myShader;
|
|
1196
1113
|
* const cols = 10;
|
|
1197
1114
|
* const rows = 10;
|
|
@@ -1267,8 +1184,6 @@ function vertex(p5, fn){
|
|
|
1267
1184
|
* }
|
|
1268
1185
|
* endShape();
|
|
1269
1186
|
* }
|
|
1270
|
-
* </code>
|
|
1271
|
-
* </div>
|
|
1272
1187
|
*/
|
|
1273
1188
|
fn.vertexProperty = function(attributeName, data){
|
|
1274
1189
|
// this._assert3d('vertexProperty');
|