crescent

A crescent: a disc with a smaller disc bitten out of it.

crescent(x: Val, y: Val, outerRadius: Val, innerRatio: Val, offset: Val): Expr

Import shape from shaders/std and use shape.crescent.

outerRadius is the full disc's radius, in uv. innerRatio (0–1) is the bite's radius as a fraction of it. offset is how far the bite's centre is shifted sideways, in uv.

Parameters

NameTypeNotes
xVal
yVal
outerRadiusVal
innerRatioVal
offsetVal

Example

shape: {distance: ({x, y}, u) => crescent(x, y, u('radius'), u('innerRatio'), u('offset')), …}

See also

  • ring — A ring: a circular band around a centre.
  • vesica — A vesica: the lens where two equal circles overlap.

Used by

Crescent