Skip to content

WheelLayout

WheelLayout is a Layout module that arranges spokes x ledsPerSpoke physical LEDs as radial lines from a centre point, like the spokes of a wheel. It demonstrates multi-spoke non-rectangular fixtures with a sparse virtual grid.

Purpose

Wheel or sun-burst fixtures are common in LED art installations. With WheelLayout any effect runs across a full square virtual grid and the spoke LEDs display only the pixels along their radial paths, creating natural rotational patterns without effect-specific code.

Controls

Key UI type Min Max Default Description
spokes slider 2 64 8 Number of radial spokes
ledsPerSpoke slider 1 128 15 LEDs per spoke (innermost to outermost)

Wiring

Add as a child of a DriverLayer:

{ "type": "WheelLayout", "id": "wheel1", "parent_id": "driver1",
  "props": { "spokes": 12, "ledsPerSpoke": 20 } }

Behaviour

  • Virtual grid: (2*ledsPerSpoke+1) x (2*ledsPerSpoke+1) x 1. Eight spokes of 15 LEDs → 31 x 31 canvas.
  • Physical mapping: spoke s runs along angle s * 2pi / spokes. LED at position p (1 = innermost) maps to (cx + round(p * cos(angle)), cy + round(p * sin(angle)), 0).
  • Physical index order: spoke 0 innermost-to-outermost, then spoke 1, etc.
  • Centre cell: the virtual centre cell (ledsPerSpoke, ledsPerSpoke, 0) has no physical LED (no LED at distance 0).
  • onUpdate: any control change triggers onChildrenReady() on the parent DriverLayer to rebuild the PhysMap.

Test coverage

See Non-Rectangular Layouts — extent dimensions, physCount, spoke 0 innermost and outermost landmark positions.

Source