---
title: "PolygonShapeGeometry"
description: "Geometry describing a polygon's [vertices], [center], and [rounding]."
type: "class"
lastmod: "2026-09-24"
---
## API Reference

> Source set: Common

```kotlin
public class PolygonShapeGeometry internal constructor(
    public val vertices: List<Offset>,
    public val center: Offset,
    public val rounding: CornerRounding,
    @get:Suppress("NullableCollection") public val perVertexRounding: List<CornerRounding>?,
    internal val roundingReference: Size? = null,
)
```

Geometry describing a polygon's `vertices`, `center`, and `rounding`.

The consumer defines the coordinate space. [PolygonShapeScope](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/PolygonShapeScope/api) factories create geometry in
pixels in the layout's coordinate space, while geometry passed directly to [PolygonShape](/jetpack-compose/androidx.compose.foundation/foundation/functions/PolygonShape/api) uses an
author-chosen space and is scaled into the layout bounds at resolution time.

Rounding resolves in the vertex coordinate space. A float radius is a length in that space, and a
percent radius resolves against the smaller dimension of the vertex bounds.

## Functions

### equals

> Source set: Common

```kotlin
override fun equals(other: Any?): Boolean
```

### hashCode

> Source set: Common

```kotlin
override fun hashCode(): Int
```

### toString

> Source set: Common

```kotlin
override fun toString(): String
```

## Members

### CornerRounding

> Source set: Common

```kotlin
public class CornerRounding internal constructor(
        internal val value: Float,
        internal val unit: Int,
        internal val smoothing: Float,
    )
```

Amount and quality of rounding around a polygon vertex.

A corner takes one of three forms:
- unrounded, with a radius of 0, keeping the sharp vertex;
- rounded with a circular arc, with a `smoothing` of 0, following an approximated circular
arc between adjacent edges;
- rounded with continuous curvature, with `smoothing` > 0, where two symmetric cubic Bézier
flanking curves connect the circular arc to the edges. A `smoothing` of 0 keeps a purely
circular arc and 1 maximizes the flanking curves so they meet in the middle.

## Functions

### equals

> Source set: Common

```kotlin
override fun equals(other: Any?): Boolean
```

### hashCode

> Source set: Common

```kotlin
override fun hashCode(): Int
```

### toString

> Source set: Common

```kotlin
override fun toString(): String
```

## Members

### Companion

> Source set: Common

```kotlin
public companion object
```

## Properties

### Unrounded

> Source set: Common

```kotlin
public val Unrounded: CornerRounding = CornerRounding(0f, UnitLength, 0f)
```

Rounding with a radius of zero, producing a sharp corner at the vertex.

### Companion

> Source set: Common

```kotlin
public companion object
```

## Functions

### CornerRounding

> Source set: Common

```kotlin
public fun CornerRounding(radius: Float, smoothing: Float = 0f): CornerRounding
```

Creates a `CornerRounding` with a `radius` in the same coordinate space as the vertices.

#### Parameters

| | |
| --- | --- |
| radius | rounding radius in the vertex coordinate space, at least 0 |
| smoothing | the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc; there are no flanking curves. A value of 1 indicates that there is no circular arc in the center; the flanking curves on either side meet at the middle. |

#### Throws: IllegalArgumentException

if `radius` is negative or [smoothing](#smoothing) is outside the range 0 to 1

### CornerRounding

> Source set: Common

```kotlin
public fun CornerRounding(radius: Dp, smoothing: Float = 0f): CornerRounding
```

Creates a `CornerRounding` with a `radius` in `Dp`, resolved with the shape's density.

#### Parameters

| | |
| --- | --- |
| radius | rounding radius of the corner, at least 0 |
| smoothing | the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc; there are no flanking curves. A value of 1 indicates that there is no circular arc in the center; the flanking curves on either side meet at the middle. |

#### Throws: IllegalArgumentException

if `radius` is negative or unspecified, or [smoothing](#smoothing) is outside the range 0 to 1

### CornerRounding

> Source set: Common

```kotlin
public fun CornerRounding(
            @IntRange(from = 0, to = 100) percent: Int,
            smoothing: Float = 0f,
        ): CornerRounding
```

Creates a `CornerRounding` with a radius as a `percent` of the geometry it applies to.

The reference is the generating radius for regular polygons and stars, or the smaller
dimension of the vertex bounds for vertex-list geometry, so the radius scales with the
shape rather than with the layout container.

#### Parameters

| | |
| --- | --- |
| percent | rounding radius as a percentage of the geometry, in the range 0 to 100 |
| smoothing | the amount by which the arc is "smoothed" by extending the curve from the inner circular arc to the edge between vertices. A value of 0 (no smoothing) indicates that the corner is rounded by only a circular arc; there are no flanking curves. A value of 1 indicates that there is no circular arc in the center; the flanking curves on either side meet at the middle. |

#### Throws: IllegalArgumentException

if `percent` is outside the range 0 to 100 or [smoothing](#smoothing) is outside the range 0 to 1

## Code Examples

### UnitSpacePolygonShapeSample

```kotlin
@Sampled
@Composable
fun UnitSpacePolygonShapeSample() {
    // A kite authored in the unit square [0..1] with per-vertex rounding in the same coordinate
    // space. The shape scales and centers into any container preserving its aspect ratio.
    val kite = remember {
        PolygonShape(
            PolygonShapeGeometry(
                vertices =
                    listOf(Offset(0.5f, 0f), Offset(1f, 0.4f), Offset(0.5f, 1f), Offset(0f, 0.4f)),
                perVertexRounding =
                    listOf(
                        CornerRounding(0.1f),
                        CornerRounding(0.15f),
                        CornerRounding(0.05f),
                        CornerRounding(0.15f),
                    ),
            )
        )
    }

    Box(Modifier.size(width = 120.dp, height = 84.dp).clip(kite).background(Color(0xFF673AB7)))
}
```
