ring

A ring: a circular band around a centre.

ring(x: Val, y: Val, radius: Val, thickness: Val): Expr

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

radius is the distance to the middle of the band, thickness half the band's width, both in uv. The full band is twice thickness wide.

Parameters

NameTypeNotes
xVal
yVal
radiusVal
thicknessVal

Example

shape: {distance: ({x, y}, u) => ring(x, y, u('radius'), u('thickness')), rotatable: false, …}

Tip. Rotationally symmetric, so declare rotatable: false and the rotation prop is left out.

See also

  • circle — A circle of a given radius.
  • arc — A pie wedge: a filled sector of a circle.
  • crescent — A crescent: a disc with a smaller disc bitten out of it.

Used by

Ring