FastLED 3.9.15
Loading...
Searching...
No Matches
corkscrew.h File Reference

Detailed Description

Corkscrew LED strip projection and rendering.

The Corkscrew class provides a complete solution for drawing to densely-wrapped helical LED strips. It maps a cylindrical coordinate system to a linear LED strip, allowing you to draw on a rectangular surface and have it correctly projected onto the corkscrew topology.

Usage:

  1. Create a Corkscrew with the number of turns and LEDs
  2. Draw patterns on the input surface using surface()
  3. Call draw() to map the surface to LED pixels
  4. Access the final LED data via rawData()

The class handles:

  • Automatic cylindrical dimension calculation
  • Pixel storage (external span or internal allocation)
  • Multi-sampling for smooth projections
  • Gap compensation for non-continuous wrapping
  • Iterator interface for advanced coordinate access

Parameters:

  • totalTurns: Number of helical turns around the cylinder
  • numLeds: Total number of LEDs in the strip
  • invert: Reverse the mapping direction (default: false)
  • gapParams: Optional gap compensation for solder points in a strip.

Definition in file corkscrew.h.

#include "fl/allocator.h"
#include "fl/geometry.h"
#include "fl/math.h"
#include "fl/math_macros.h"
#include "fl/pair.h"
#include "fl/tile2x2.h"
#include "fl/vector.h"
#include "fl/shared_ptr.h"
#include "fl/variant.h"
#include "fl/span.h"
#include "crgb.h"
#include "fl/int.h"
+ Include dependency graph for corkscrew.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fl::Corkscrew
 
class  fl::Corkscrew::iterator
 
struct  fl::Gap
 Struct representing gap parameters for corkscrew mapping. More...
 

Namespaces

namespace  fl
 IMPORTANT!
 

Functions

constexpr fl::u16 fl::calculateCorkscrewHeight (float totalTurns, fl::u16 numLeds)
 
constexpr fl::u16 fl::calculateCorkscrewWidth (float totalTurns, fl::u16 numLeds)