PinwheelModifier
Source:
PinwheelModifier.h
PinwheelModifier¶
src/light/modifiers/PinwheelModifier.h:26Inherits:
ModifierBase
Modifier remapping the grid into radial petals.
Public Attributes¶
uint8_t petals = 60
: How many petals the wheel is divided into.
int16_t swirl = 30
: How far a petal twists along its radius, a negative value reversing the swirl.
bool reverse = false
: Whether the wheel turns the other way.
uint8_t symmetry = 1
: How many times the pattern repeats around the turn.
uint8_t zTwist = 0
: How much the pattern advances per z layer.
Public Methods¶
virtual inline const char * tags() const override
: The catalog tags this modifier carries.
virtual inline Dim dimensions() const override
: Polar around a center in the x/y plane.
virtual inline void defineControls() override
: The controls a user sets on the card.
virtual inline void modifyLogicalSize(Coord3D & size) override
: Resize the logical box this modifier presents to the effect.
virtual inline bool modifyLogical(Coord3D & pos) const override
: Transform one light's logical position, false dropping it from the mapping.
More info¶
Polar remap: folds the logical box into petals angular wedges radiating from the box center, a pinwheel. Each physical light's angle about the center picks a petal (x), and (in 2D+) its radius becomes the along-petal coordinate (y). A 1D effect scrolls outward along every spoke and a 2D effect paints across the wheel. The swirl shears the angle by radius, giving a spiral, and the symmetry divides the full turn into a repeating sub-arc. The twist rotates the wheel per z slice, and the reverse flag flips the petal order.
Prior art¶
Prior art: MoonLight's Pinwheel modifier (M_MoonLight.h), same atan2 petal binning, hypot swirl shear, FACTORS[]-of-360 symmetry table, and per-slice zTwist. Written fresh against our fold interface. The source gates on the effect's own dimensionality, which a modifier here cannot see, so the question becomes whether the incoming box is two-dimensional. Pins/wiring plumbing is dropped; this emits coordinates only. Float math (atan2/hypot/sqrt) runs on the build path (modifyLogical is called at rebuild, not in the hot render loop). Author: MoonLight, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Modifiers/M_MoonLight.h