> Documentation index: https://developer.android.com/reference/llms.txt

# SurfaceGeometrySpec

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/lighting/SurfaceGeometrySpec.kt+class:androidx.compose.ui.lighting.SurfaceGeometrySpec) Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01) Common/All
- Cmn

  ```
  sealed class SurfaceGeometrySpec
  ```

*** ** * ** ***

Describes the virtual three-dimensional shape that a lit surface is treated as having.

A spec is resolution independent. It is resolved into concrete geometry once the surface's size, layout direction and density are known, so a single spec can be shared between surfaces of different sizes.

Lighting is currently implemented only for rectangles, and for rounded rectangles whose corners each have a circular radius (`x == y`). Any other shape, including `CutCornerShape`, `GenericShape`, and rounded rectangles with elliptical corner radii, throws an `IllegalArgumentException` when the spec is resolved.

## Summary

| ### Public companion functions |
|---|---|---|
| `SurfaceGeometrySpec` | `concave(shape: Shape, thickness: Dp, bevelWidth: Dp)` A surface that dishes away from the viewer, like a bowl. | Cmn |
| `SurfaceGeometrySpec` | `convex(shape: Shape, thickness: Dp, bevelWidth: Dp)` A surface that bulges towards the viewer, like a dome. | Cmn |
| `SurfaceGeometrySpec` | `flat(shape: Shape, thickness: Dp)` A surface whose interior is flat and faces the viewer directly. | Cmn |

| ### Protected constructors |
|---|---|
| `SurfaceGeometrySpec()` | Cmn |

## Public companion functions

### concave

Cmn Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01)

```
fun concave(shape: Shape, thickness: Dp, bevelWidth: Dp): SurfaceGeometrySpec
```

A surface that dishes away from the viewer, like a bowl.

The interior is flat and the outline is wrapped in a curved band whose width is determined by `bevelWidth`. The normals tilt inwards, towards the center of the surface. The curved surface falls into shadow on the side facing a light and illuminates on the opposite side, giving the surface a depressed shade.

| Parameters |
|---|---|
| `shape: Shape` | outline of the lit surface. See the class documentation for the shapes that are supported. |
| `thickness: Dp` | height of the surface towards the viewer. The attenuation of the light is calculated based on the resultant distance `lightElevation - surfaceThickness`. The thickness is considered uniform over the surface. |
| `bevelWidth: Dp` | width of the curved band along the outline. Clamped to half of the surface's smaller dimension when resolved. |

| Throws |
|---|---|
| `IllegalArgumentException` | if `thickness` or `bevelWidth` is `Dp.Unspecified` or `bevelWidth` is negative. |

### convex

Cmn Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01)

```
fun convex(shape: Shape, thickness: Dp, bevelWidth: Dp): SurfaceGeometrySpec
```

A surface that bulges towards the viewer, like a dome.

The interior is flat and the outline is wrapped in a curved band whose width is determined by `bevelWidth`. The normals tilt outwards, away from the center of the surface. The curved surface catches a highlight on the side facing a light and falls into shadow on the opposite side, giving the surface a rounded, physical edge.

| Parameters |
|---|---|
| `shape: Shape` | outline of the lit surface. See the class documentation for the shapes that are supported. |
| `thickness: Dp` | height of the surface towards the viewer. The attenuation of the light is calculated based on the resultant distance `lightElevation - surfaceThickness`. The thickness is considered uniform over the surface. |
| `bevelWidth: Dp` | width of the curved band along the outline. Clamped to half of the surface's smaller dimension when resolved. |

| Throws |
|---|---|
| `IllegalArgumentException` | if `thickness` or `bevelWidth` is `Dp.Unspecified` or `bevelWidth` is negative. |

### flat

Cmn Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01)

```
fun flat(shape: Shape, thickness: Dp): SurfaceGeometrySpec
```

A surface whose interior is flat and faces the viewer directly.

Every interior pixel shares the same normal, so the interior takes a single even shade This reads as a sheet of material rather than as a solid object, and `SurfaceMaterial.fresnel` adds an even brightening instead of a rim.

| Parameters |
|---|---|
| `shape: Shape` | outline of the lit surface. See the class documentation for the shapes that are supported. |
| `thickness: Dp` | height of the surface towards the viewer. The attenuation of the light is calculated based on the resultant distance `lightElevation - surfaceThickness`. |

| Throws |
|---|---|
| `IllegalArgumentException` | if `thickness` is `Dp.Unspecified`. |

## Protected constructors

### SurfaceGeometrySpec

Cmn

```
protected SurfaceGeometrySpec()
```