From eb2d0d2b4a5a66e681f131bc8da57ba05d345dc2 Mon Sep 17 00:00:00 2001 From: codervinitjangir Date: Sat, 14 Mar 2026 15:30:57 +0530 Subject: [PATCH 1/2] docs: remove broken links to beginGeometry/endGeometry in v2.0 --- src/core/p5.Renderer3D.js | 8 ++------ src/webgl/3d_primitives.js | 30 +----------------------------- src/webgl/loading.js | 4 +--- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/src/core/p5.Renderer3D.js b/src/core/p5.Renderer3D.js index 4241a56157..b4ca7a015c 100644 --- a/src/core/p5.Renderer3D.js +++ b/src/core/p5.Renderer3D.js @@ -418,12 +418,11 @@ export class Renderer3D extends Renderer { /** * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added * to the geometry and then returned when - * endGeometry() is called. One can also use * buildGeometry() to pass a function that * draws shapes. * * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `beginGeometry()` and `endGeometry()` and then + * combining them upfront with `buildGeometry()` and then * drawing that will run faster than repeatedly drawing the individual pieces. * @private */ @@ -440,7 +439,7 @@ export class Renderer3D extends Renderer { /** * Finishes creating a new p5.Geometry that was - * started using beginGeometry(). One can also + * One can also * use buildGeometry() to pass a function that * draws shapes. * @private @@ -472,9 +471,6 @@ export class Renderer3D extends Renderer { * combining them with `buildGeometry()` once and then drawing that will run * faster than repeatedly drawing the individual pieces. * - * One can also draw shapes directly between - * beginGeometry() and - * endGeometry() instead of using a callback * function. * @param {Function} callback A function that draws shapes. * @returns {p5.Geometry} The model that was built from the callback function. diff --git a/src/webgl/3d_primitives.js b/src/webgl/3d_primitives.js index bafd307b7e..85924e75d4 100644 --- a/src/webgl/3d_primitives.js +++ b/src/webgl/3d_primitives.js @@ -111,12 +111,6 @@ function primitives3D(p5, fn){ * will run faster than repeatedly drawing the individual pieces. * * The parameter, `callback`, is a function with the drawing instructions for - * the new p5.Geometry object. It will be called - * once to create the new 3D shape. - * - * See beginGeometry() and - * endGeometry() for another way to build 3D - * shapes. * * Note: `buildGeometry()` can only be used in WebGL mode. * @@ -321,12 +315,8 @@ function primitives3D(p5, fn){ * p5.Geometry objects can contain lots of data * about their vertices, surface normals, colors, and so on. Complex 3D shapes * can use lots of memory which is a limited resource in many GPUs. Calling - * `freeGeometry()` can improve performance by freeing a - * p5.Geometry object’s resources from GPU memory. * `freeGeometry()` works with p5.Geometry objects - * created with beginGeometry() and - * endGeometry(), - * buildGeometry(), and + * created with buildGeometry() and * loadModel(). * * The parameter, `geometry`, is the p5.Geometry @@ -342,24 +332,6 @@ function primitives3D(p5, fn){ * @param {p5.Geometry} geometry 3D shape whose resources should be freed. * * @example - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * background(200); - * - * // Create a p5.Geometry object. - * beginGeometry(); - * cone(); - * let shape = endGeometry(); - * - * // Draw the shape. - * model(shape); - * - * // Free the shape's resources. - * freeGeometry(shape); - * } - * - * @example * // Click and drag the mouse to view the scene from different angles. * * let button; diff --git a/src/webgl/loading.js b/src/webgl/loading.js index 6f726b15cc..23fe61b123 100755 --- a/src/webgl/loading.js +++ b/src/webgl/loading.js @@ -972,9 +972,7 @@ function loading(p5, fn){ * The parameter, `model`, is the * p5.Geometry object to draw. * p5.Geometry objects can be built with - * buildGeometry(), or - * beginGeometry() and - * endGeometry(). They can also be loaded from + * buildGeometry(). They can also be loaded from * a file with loadGeometry(). * * Note: `model()` can only be used in WebGL mode. From a2adbaa0f00ae725b7dbbe5c05323c43d2f1274c Mon Sep 17 00:00:00 2001 From: codervinitjangir Date: Tue, 17 Mar 2026 22:32:13 +0530 Subject: [PATCH 2/2] docs: resolve PR feedback - revert private docs and fix buildGeometry formatting --- src/core/p5.Renderer3D.js | 8 ++++++-- src/webgl/3d_primitives.js | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/p5.Renderer3D.js b/src/core/p5.Renderer3D.js index b4ca7a015c..4241a56157 100644 --- a/src/core/p5.Renderer3D.js +++ b/src/core/p5.Renderer3D.js @@ -418,11 +418,12 @@ export class Renderer3D extends Renderer { /** * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added * to the geometry and then returned when + * endGeometry() is called. One can also use * buildGeometry() to pass a function that * draws shapes. * * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `buildGeometry()` and then + * combining them upfront with `beginGeometry()` and `endGeometry()` and then * drawing that will run faster than repeatedly drawing the individual pieces. * @private */ @@ -439,7 +440,7 @@ export class Renderer3D extends Renderer { /** * Finishes creating a new p5.Geometry that was - * One can also + * started using beginGeometry(). One can also * use buildGeometry() to pass a function that * draws shapes. * @private @@ -471,6 +472,9 @@ export class Renderer3D extends Renderer { * combining them with `buildGeometry()` once and then drawing that will run * faster than repeatedly drawing the individual pieces. * + * One can also draw shapes directly between + * beginGeometry() and + * endGeometry() instead of using a callback * function. * @param {Function} callback A function that draws shapes. * @returns {p5.Geometry} The model that was built from the callback function. diff --git a/src/webgl/3d_primitives.js b/src/webgl/3d_primitives.js index 85924e75d4..cd6cccc893 100644 --- a/src/webgl/3d_primitives.js +++ b/src/webgl/3d_primitives.js @@ -111,7 +111,8 @@ function primitives3D(p5, fn){ * will run faster than repeatedly drawing the individual pieces. * * The parameter, `callback`, is a function with the drawing instructions for - * + * the new p5.Geometry object. It will be called + * once to create the new 3D shape. * Note: `buildGeometry()` can only be used in WebGL mode. * * @method buildGeometry