createPolygonPath
import { createPolygonPath, Path } from "@pibbl/core";PolygonPathOptions is accepted by createPolygonPath(options): Path2D, which creates a fresh
closed path from finite numeric pairs, with optional numeric corner radii.
Short lists are safe empty geometry; no render state or events are owned.
<Path style={{ d: createPolygonPath({ coords: [ [0, 80], [50, 0], [100, 80], ], }), fill: "#f59e0b", }}/>See the Polygon live example.
API details from source
Section titled “API details from source”
Creates a Canvas Path2D for polygon geometry from validated options.
createPolygonPath: (options: Readonly<PolygonPathOptions>) => Path2DRelated API: createPolygonPath, PolygonPathOptions.
Parameters
Section titled “Parameters”options— Ordered polygon vertices and corner rounding settings. See PolygonPathOptions .
Returns
Section titled “Returns”A native Canvas path containing the polygon.
See also
Section titled “See also”View source — packages/core/src/lib/geometry/polygon.ts:25
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Polygon path factories: Create rounded rectangles and polygons alongside regular and star shapes. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 380919b. ALPHA — NOT FOR PRODUCTION USE.