createRegularPolygonPath
import { createRegularPolygonPath, Path } from "@pibbl/core";RegularPolygonPathOptions is accepted by createRegularPolygonPath(options): Path2D, which requires
integer sides >= 3 and exactly one numeric size field. Optional position,
rotation, and numeric corner radii produce a fresh pure path.
<Path style={{ d: createRegularPolygonPath({ sides: 6, circumradius: 48 }), fill: "#22c55e", }}/>See the Regular polygon live example.
API details from source
Section titled “API details from source”
Creates a Canvas Path2D for regular polygon geometry from validated options.
createRegularPolygonPath: (options: Readonly<RegularPolygonPathOptions>) => Path2DRelated API: createRegularPolygonPath, RegularPolygonPathOptions.
Parameters
Section titled “Parameters”options— Polygon center, radius, side count, and rotation. See RegularPolygonPathOptions .
Returns
Section titled “Returns”A native Canvas path containing the regular polygon.
See also
Section titled “See also”View source — packages/core/src/lib/geometry/regular-polygon.ts:167
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 2dccb19. ALPHA — NOT FOR PRODUCTION USE.