RingLayout
Source:
RingLayout.h
RingLayout¶
src/light/layouts/RingLayout.h:21Inherits:
LayoutBase
Layout of a single ring of evenly-spaced LEDs.
Author: MoonLight, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Layouts/L_MoonLight.h
Public Attributes¶
uint8_t nrOfLEDs = 24
: MoonLight defaults and ranges, preserved verbatim.
uint16_t angleFirst = 0
uint16_t rotation = 360
: The arc span in degrees, under 360 emitting a partial ring.
bool clockwise = true
: Which way the arc is walked.
uint8_t scale = 1
: The spacing multiplier out from the center, 1 to 10.
Public Methods¶
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 void defineControls() override
: The controls a user sets on the card.
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¶
A ring of lights: nrOfLEDs placed evenly around a circle, optionally a partial arc (rotation < 360, clockwise or counter-clockwise from angleFirst) and scaled out from the center. Every light sits at an integer (x, y, 0). The circle center is placed at ~1.1× the ring radius on both axes so the whole ring lands in the positive quadrant.
Prior art: MoonLight's RingLayout (ewowi/MoonLight, src light layout nodes). The geometry is reproduced exactly: the radius, the placement angle, the center offset, the partial-arc filter and the integer truncation of every coordinate. MoonLight's pin/wiring plumbing (doNextPin/nextPin) is dropped, a MoonLight layout emits coordinates only; the driver owns pins.
Float trig runs on the cold build path (placeLights / lightCount, called from a rebuild), never the hot render loop, so it's allowed here.