beginShape()
Begin an extruded path built from vertex() points.
The first vertex() after beginShape() positions the nozzle at the start of the
path; every following vertex() extrudes to the next point. mode chooses how the
first move is made i.e. how the nozzle reaches the path start:
TRAVEL: retract, z-hop, and re-prime (the default; liketravelTo())RETRACT: retract and re-prime, no z-hop (likeretractTo())MOVE: a plain move with no retraction or z-hop (likemoveTo())EXTRUDE: extrude from the current position to the first point (likeextrudeTo())
Call endShape() to finish, or endShape(CLOSE) to extrude back to the first vertex.
The functionality follows beginShape() / vertex() / endShape() in p5.js.
Parameters
| Name | Type | Description |
|---|---|---|
mode? | string | Lead-in for the first vertex: TRAVEL, RETRACT, MOVE, or EXTRUDE. Default: TRAVEL. |
Examples
Syntax
fab.beginShape([mode])