cellBorders

A mask of the lines between cells: 0 on a boundary, 1 inside a cell.

cellBorders(cells: Field, slots: {softness: PropRef; scale: PropRef}): Field

Import noise from shaders/std and use noise.cellBorders.

softness is the line width (0 to about 0.4). Pass the same scale as cellDistances so the lines keep their width when the cell count changes. Takes the (d1, d2) field. Use it as the mask of borderOverlay.

Parameters

NameTypeNotes
cellsField
slots{softness: PropRef; scale: PropRef}

Example

cellBorders(cells, {softness: p('edgeSoftness'), scale: p('scale')})

See also

  • cellDistances — Distances from each pixel to its nearest two cell points, as (d1, d2): the raw material for Voronoi fills and borders.
  • borderOverlay — Draws a color over a paint wherever a mask falls to 0, keeping the paint's alpha.

Used by

Voronoi