* 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. *
()
| 436 | * @private |
| 437 | */ |
| 438 | beginGeometry() { |
| 439 | if (this.geometryBuilder) { |
| 440 | throw new Error( |
| 441 | "It looks like `beginGeometry()` is being called while another p5.Geometry is already being build." |
| 442 | ); |
| 443 | } |
| 444 | this.geometryBuilder = new GeometryBuilder(this); |
| 445 | this.geometryBuilder.prevFillColor = this.states.fillColor; |
| 446 | this.fill(new Color([-1, -1, -1, -1])); |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * Finishes creating a new <a href="#/p5.Geometry">p5.Geometry</a> that was |