---
title: "cellFrame"
description: "The shared coordinate system of a tiled pattern: how many cells fit down the canvas height and how far the whole lattice is rotated."
group: "paint"
groupTitle: "Painting"
categoryId: "patterns"
categorySlug: "patterns"
categoryTitle: "Patterns & tiling"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/patterns.ts#L97"
---

# cellFrame

The shared coordinate system of a tiled pattern: how many cells fit down the canvas height and how far the whole lattice is rotated.

```ts
cellFrame(slots: {cells: PropRef; rotation: PropRef; convention: CellFrameConvention}): PatternPaint
```

Import `patterns` from `shaders/std` and use `patterns.cellFrame`.

`cells` counts cells along the canvas height, so cells stay square as the canvas resizes. `rotation` is in degrees about the canvas centre. Pass the result as the `frame` of `gridLines`, `hexLines`, `triangleLines`, `truchetArcs`, `weaveThreads` or `isoCubeFaces`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{cells: PropRef; rotation: PropRef; convention: CellFrameConvention}` |  |

## Example

```ts
const field = gridLines({frame: cellFrame({cells: p('cells'), rotation: p('rotation'), convention: 'flippedY'}), thickness: p('thickness'), softness: p('softness'), variation: p('variation')})
```

> **Tip.** One frame can feed several line words. It is evaluated once however many read it.

## See also

- [`gridLines`](/docs/primitives/patterns/gridlines) — Square grid lines drawn in a `cellFrame`, plus a per-cell shade for the fill.
- [`hexLines`](/docs/primitives/patterns/hexlines) — Honeycomb lines (pointy-top hexagons) drawn in a `cellFrame`, plus a per-cell shade.
- [`triangleLines`](/docs/primitives/patterns/trianglelines) — A lattice of equilateral triangles drawn in a `cellFrame`, with rows that can drift.
- [`truchetArcs`](/docs/primitives/patterns/truchetarcs) — A maze of quarter-circle arcs, two per tile, flipped at random so they join into flowing curves.
- [`weaveThreads`](/docs/primitives/patterns/weavethreads) — Two sets of threads woven over and under each other, returned as a finished color.
- [`isoCubeFaces`](/docs/primitives/patterns/isocubefaces) — Tumbling blocks: three shaded rhombus faces per hexagon that read as a field of 3D cubes.

## Used by

[Grid](/docs/components/grid), [HexGrid](/docs/components/hexgrid), [IsometricCubes](/docs/components/isometriccubes), [TriangularGrid](/docs/components/triangulargrid), [Truchet](/docs/components/truchet), [Weave](/docs/components/weave)