star

A star with straight sides and sharp points.

star(x: Val, y: Val, outerRadius: Val, sides: Val, innerRatio: Val): Expr

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

outerRadius is the distance from the centre to the tips, in uv. sides is the number of points. innerRatio (0–1) is the inner corner radius as a fraction of the tip radius. 0.382 gives the classic five-point star. One tip points right at rotation 0.

Parameters

NameTypeNotes
xVal
yVal
outerRadiusVal
sidesVal
innerRatioVal

Example

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

See also

  • flower — A flower with pointed petals and V-shaped valleys between them.
  • polygon — A regular polygon with any number of sides.

Used by

Star