---
title: "sectorFold"
description: "Fold a point into one mirrored wedge around a centre: the kaleidoscope fold."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "frames"
categorySlug: "frames"
categoryTitle: "Frames & coordinates"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/frames.ts#L223"
---

# sectorFold

Fold a point into one mirrored wedge around a centre: the kaleidoscope fold.

```ts
sectorFold(x: Expr, y: Expr, sectorAngle: Expr, center: number = 0.5): Expr
```

Import `frames` from `shaders/std` and use `frames.sectorFold`.

`sectorAngle` is the wedge's angle in radians (2π divided by the number of facets). `center` is where the wedges meet, 0.5 by default. Returns the folded point as an offset from the centre. Sample anything at that point and it repeats and mirrors around the centre.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Expr` |  |
| `y` | `Expr` |  |
| `sectorAngle` | `Expr` |  |
| `center` | `number` | Optional. Default `0.5`. |

## Example

```ts
const folded = sectorFold(uv.member('x'), uv.member('y'), math.div(2 * Math.PI, params.uniforms.facets))
```

## See also

- [`directionFrame`](/docs/primitives/frames/directionframe) — The two axes of a direction given in degrees, for patterns that run along it.
- [`centredFrame`](/docs/primitives/frames/centredframe) — A frame centred on a position prop: each pixel's offset from the centre and its distance.

## Used by

[Crystal](/docs/components/crystal)