# createRegularPolygonPath

```ts
import { createRegularPolygonPath, Path } from "@pibbl/core";
```

[`RegularPolygonPathOptions`](/reference/types/elements-components/#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.

```tsx
<Path
  style={{
    d: createRegularPolygonPath({ sides: 6, circumradius: 48 }),
    fill: "#22c55e",
  }}
/>
```

See the [Regular polygon live example](/playground/#/examples/drawing/regular-polygon).

## API details from source

<span id="api-createRegularPolygonPath"></span>

Creates a Canvas Path2D for regular polygon geometry from validated options.

```ts
createRegularPolygonPath: (options: Readonly<RegularPolygonPathOptions>) => Path2D
```

Related API: [createRegularPolygonPath](/reference/functions/create-regular-polygon-path/), [RegularPolygonPathOptions](/reference/types/elements-components/#regularpolygonpathoptions).

### Parameters

- **`options`** — Polygon center, radius, side count, and rotation. See
[RegularPolygonPathOptions](/reference/types/elements-components/#regularpolygonpathoptions) .

### Returns

A native Canvas path containing the regular polygon.

### See also

[RegularPolygonPathOptions](/reference/types/elements-components/#regularpolygonpathoptions)

[View source — packages/core/src/lib/geometry/regular-polygon.ts:167](/source/packages/core/src/lib/geometry/regular-polygon-ts/#L167)

## Implementation guidance for agents

Read the [Drawing, layout, and effects companion](/agents/topics/layout/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Polygon path factories](/minimal-examples/paths/polygon-factories/): Create rounded rectangles and polygons alongside regular and star shapes. [Plain source](/minimal/paths/polygon-factories.ts)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
