TorontoBarGourdsLayout
Source:
TorontoBarGourdsLayout.h
TorontoBarGourdsLayout¶
src/light/layouts/TorontoBarGourdsLayout.h:29Inherits:
LayoutBase
Layout for the Toronto bar decorative-gourd installation.
Author: troyhacks, reconstructed for MoonLight, https://github.com/troyhacks/WLED
Public Attributes¶
uint8_t nrOfLightsPerGourd = 61
: How many stacked lights one gourd contributes, in the coarsest mode.
uint8_t granularity = 2
: Granularity select (0/1/2). MoonLight default 2 ("One LED One Light").
Public Methods¶
virtual inline void defineControls() override
: The controls a user sets on the card.
virtual inline const char * tags() const override
: The catalog tags this layout carries.
virtual inline Dim dimensions() const override
: How many axes this layout places lights on.
virtual inline nrOfLightsType lightCount() const override
: How many lights the current settings place.
virtual inline void placeLights(const CoordSink & sink) const override
: Emit every light's coordinate, in wiring order.
More info¶
The Toronto Bar "gourds" installation: 24 gourd fixtures placed at fixed positions in a 3D grid, each gourd rendered at one of three granularities. A gourd is a small five-sided body (front/back/left/right/bottom + a middle point); the granularity control trades physical fidelity for light count:
0 "One Gourd One Light", nrOfLightsPerGourd lights, all stacked on the gourd's raw grid position (a whole gourd = one logical point, replicated). 1 "One Side One Light", gourdLength 3. Five sides, each 12 LEDs mapped to the same virtual pixel, + 1 middle LED = 61/gourd. 2 "One LED One Light", gourdLength 7. Five cube faces, each a 12-pixel perimeter ring, + 1 middle LED = 61/gourd.
Prior art¶
Prior art: MoonLight's TorontoBarGourdsLayout (Node "Toronto Bar Gourds", tags 🚥). The gourd grid, all three per-mode Coord3D tables, the gourdLength constants (3 and 7), and every +offset are reproduced verbatim; the geometry IS the spec. MoonLight's pin plumbing (nextPin() every 10 gourds) is dropped, a MoonLight layout emits coordinates only; the driver owns pins. tags 💫 marks the MoonLight lineage.
A single walk() is the one source of truth for the geometry: [lightCount()] runs it with a no-op callback to tally, [placeLights()] runs it to emit. The count and the emitted set can never disagree (the RingLayout/SphereLayout pattern). Integer math throughout; this is the cold build path.