Skip to content

SpiralLayout

Source: SpiralLayout.h

SpiralLayout

class SpiralLayout
src/light/layouts/SpiralLayout.h:23

Inherits: LayoutBase

Layout winding LEDs up a conical spiral.

Author: MoonLight, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Layouts/L_MoonLight.h

Public Attributes

lengthType ledCount = 640 : Total lights along the spiral.

lengthType bottomRadius = 10 : The radius at the base, in light-units.

lengthType height = 25 : The vertical rise from base to tip.

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 tapering conical spiral: lights wound up a cone whose radius falls linearly to zero at the top. The rise from base to tip is the height control. The winding rate is fixed at the base's light density, one light per unit of its circumference. The angle therefore simply accumulates while the radius shrinks, so the spiral packs tightly near the base and opens out toward the tip. The whole shape is offset so its base sits at (bottomRadius, 0, bottomRadius), keeping every coordinate non-negative.

Prior art: MoonLight SpiralLayout (ewowi/MoonLight, src light nodes). The geometry is reproduced exactly, its float trig running on the cold build path rather than the render loop. The source's own trig calls and its truncation of each coordinate are kept as they are. MoonLight's per-strip pin plumbing (nextPin) is dropped: a MoonLight layout emits coordinates only; the driver owns wiring.