MCPcopy
hub / github.com/processing/p5.js / endGeometry

Method endGeometry

src/core/p5.Renderer3D.js:458–472  ·  view source on GitHub ↗

* Finishes creating a new p5.Geometry that was * started using beginGeometry() . One can also * use buildGeometry() to pass a function that * draws shapes. * @private * * @returns {p5.Geome

()

Source from the content-addressed store, hash-verified

456 * @returns {p5.Geometry} The model that was built.
457 */
458 endGeometry() {
459 if (!this.geometryBuilder) {
460 throw new Error(
461 "Make sure you call beginGeometry() before endGeometry()!"
462 );
463 }
464 const geometry = this.geometryBuilder.finish();
465 if (this.geometryBuilder.prevFillColor) {
466 this.fill(this.geometryBuilder.prevFillColor);
467 } else {
468 this.noFill();
469 }
470 this.geometryBuilder = undefined;
471 return geometry;
472 }
473
474 /**
475 * Creates a new <a href="#/p5.Geometry">p5.Geometry</a> that contains all

Callers 1

buildGeometryMethod · 0.95

Calls 3

fillMethod · 0.95
finishMethod · 0.80
noFillMethod · 0.80

Tested by

no test coverage detected