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

Detailed Description

Corkscrew projection utilities.

Corkscrew projection maps from Corkscrew (θ, h) to Cylindrical cartesian (w, h) space, where w = one turn of the Corkscrew. The corkscrew at (0,0) will map to (0,0) in cylindrical space.

The projection:

  • Super samples cylindrical space?
  • θ is normalized to [0, 1] or mapped to [0, W-1] for grid projection
  • Uses 2x2 super sampling for better visual quality
  • Works with XYPathRenderer's "Splat Rendering" for sub-pixel rendering

Inputs:

  • Total Height of the Corkscrew in centimeters
  • Total angle of the Corkscrew (number of veritcal segments × 2π)
  • Optional offset circumference (default 0)
    • Allows pixel-perfect corkscrew with gaps via circumference offsetting
    • Example (accounting for gaps):
      • segment 0: offset circumference = 0, circumference = 100
      • segment 1: offset circumference = 100.5, circumference = 100
      • segment 2: offset circumference = 101, circumference = 100

Outputs:

  • Width and Height of the cylindrical map
    • Width is the circumference of one turn
    • Height is the total number of vertical segments
  • Vector of vec2f {width, height} mapping corkscrew (r,c) to cylindrical {w,h}

Definition in file corkscrew.h.

#include "fl/allocator.h"
#include "fl/geometry.h"
#include "fl/math_macros.h"
#include "fl/tile2x2.h"
#include "fl/vector.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
 
struct  fl::CorkscrewInput
 Generates a mapping from corkscrew to cylindrical coordinates. More...
 
struct  fl::CorkscrewOutput
 
class  fl::CorkscrewOutput::iterator
 

Namespaces

namespace  fl
 Implements a simple red square effect for 2D LED grids.