@@ -116,7 +116,7 @@ let isFirstContour = true;
116116 * </code>
117117 * </div>
118118 */
119- p5 . prototype . beginContour = function ( ) {
119+ p5 . prototype . beginContour = function ( ) {
120120 if ( this . _renderer . isP3D ) {
121121 this . _renderer . beginContour ( ) ;
122122 } else {
@@ -515,7 +515,7 @@ p5.prototype.beginContour = function() {
515515 * </code>
516516 * </div>
517517 */
518- p5 . prototype . beginShape = function ( kind ) {
518+ p5 . prototype . beginShape = function ( kind ) {
519519 p5 . _validateParameters ( 'beginShape' , arguments ) ;
520520 if ( this . _renderer . isP3D ) {
521521 this . _renderer . beginShape ( ...arguments ) ;
@@ -802,7 +802,7 @@ p5.prototype.beginShape = function(kind) {
802802 * @param {Number } z4 z-coordinate of the anchor point.
803803 * @chainable
804804 */
805- p5 . prototype . bezierVertex = function ( ...args ) {
805+ p5 . prototype . bezierVertex = function ( ...args ) {
806806 p5 . _validateParameters ( 'bezierVertex' , args ) ;
807807 if ( this . _renderer . isP3D ) {
808808 this . _renderer . bezierVertex ( ...args ) ;
@@ -1210,7 +1210,7 @@ p5.prototype.bezierVertex = function(...args) {
12101210 * </code>
12111211 * </div>
12121212 */
1213- p5 . prototype . curveVertex = function ( ...args ) {
1213+ p5 . prototype . curveVertex = function ( ...args ) {
12141214 p5 . _validateParameters ( 'curveVertex' , args ) ;
12151215 if ( this . _renderer . isP3D ) {
12161216 this . _renderer . curveVertex ( ...args ) ;
@@ -1319,7 +1319,7 @@ p5.prototype.curveVertex = function(...args) {
13191319 * </code>
13201320 * </div>
13211321 */
1322- p5 . prototype . endContour = function ( ) {
1322+ p5 . prototype . endContour = function ( ) {
13231323 if ( this . _renderer . isP3D ) {
13241324 return this ;
13251325 }
@@ -1342,7 +1342,7 @@ p5.prototype.endContour = function() {
13421342} ;
13431343
13441344/**
1345- * Begins adding vertices to a custom shape.
1345+ * Stops adding vertices to a custom shape.
13461346 *
13471347 * The <a href="#/p5/beginShape">beginShape()</a> and `endShape()` functions
13481348 * allow for creating custom shapes in 2D or 3D.
@@ -1417,6 +1417,37 @@ p5.prototype.endContour = function() {
14171417 *
14181418 * <div>
14191419 * <code>
1420+ * function setup() {
1421+ * createCanvas(200, 100);
1422+ *
1423+ * background(240);
1424+ *
1425+ * noFill();
1426+ * stroke(0);
1427+ *
1428+ * // Open shape (left)
1429+ * beginShape();
1430+ * vertex(20, 20);
1431+ * vertex(80, 20);
1432+ * vertex(80, 80);
1433+ * endShape(); // Not closed
1434+ *
1435+ * // Closed shape (right)
1436+ * beginShape();
1437+ * vertex(120, 20);
1438+ * vertex(180, 20);
1439+ * vertex(180, 80);
1440+ * endShape(CLOSE); // Closed
1441+ *
1442+ * describe(
1443+ * '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.'
1444+ * );
1445+ * }
1446+ * </code>
1447+ * </div>
1448+ *
1449+ * <div>
1450+ * <code>
14201451 * // Note: A "uniform" is a global variable within a shader program.
14211452 *
14221453 * // Create a string with the vertex shader program.
@@ -1504,7 +1535,7 @@ p5.prototype.endContour = function() {
15041535 * </code>
15051536 * </div>
15061537 */
1507- p5 . prototype . endShape = function ( mode , count = 1 ) {
1538+ p5 . prototype . endShape = function ( mode , count = 1 ) {
15081539 p5 . _validateParameters ( 'endShape' , arguments ) ;
15091540 if ( count < 1 ) {
15101541 console . log ( '🌸 p5.js says: You can not have less than one instance' ) ;
@@ -1807,7 +1838,7 @@ p5.prototype.endShape = function(mode, count = 1) {
18071838 * @param {Number } y3
18081839 * @param {Number } z3 z-coordinate of the anchor point.
18091840 */
1810- p5 . prototype . quadraticVertex = function ( ...args ) {
1841+ p5 . prototype . quadraticVertex = function ( ...args ) {
18111842 p5 . _validateParameters ( 'quadraticVertex' , args ) ;
18121843 if ( this . _renderer . isP3D ) {
18131844 this . _renderer . quadraticVertex ( ...args ) ;
@@ -2034,7 +2065,7 @@ p5.prototype.quadraticVertex = function(...args) {
20342065 * @param {Number } [v] v-coordinate of the vertex's texture. Defaults to 0.
20352066 * @chainable
20362067 */
2037- p5 . prototype . vertex = function ( x , y , moveTo , u , v ) {
2068+ p5 . prototype . vertex = function ( x , y , moveTo , u , v ) {
20382069 if ( this . _renderer . isP3D ) {
20392070 this . _renderer . vertex ( ...arguments ) ;
20402071 } else {
@@ -2245,7 +2276,7 @@ p5.prototype.vertex = function(x, y, moveTo, u, v) {
22452276 * @param {Number } z z-component of the vertex normal.
22462277 * @chainable
22472278 */
2248- p5 . prototype . normal = function ( x , y , z ) {
2279+ p5 . prototype . normal = function ( x , y , z ) {
22492280 this . _assert3d ( 'normal' ) ;
22502281 p5 . _validateParameters ( 'normal' , arguments ) ;
22512282 this . _renderer . normal ( ...arguments ) ;
0 commit comments