Skip to content

Commit

Permalink
pinwheel mapping XXL - no holes at 64x64
Browse files Browse the repository at this point in the history
  • Loading branch information
softhack007 committed Aug 7, 2024
1 parent 7f9da30 commit b284464
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,13 @@ constexpr int Pinwheel_Size_Medium = 32; // larger than this -> use "Big"
constexpr int Pinwheel_Steps_Big = 304; // no holes up to 50x50
constexpr int Pinwheel_Size_Big = 50; // larger than this -> use "XL"
constexpr int Pinwheel_Steps_XL = 368;
constexpr int Pinwheel_Size_XL = 58; // larger than this -> use "XXL"
constexpr int Pinwheel_Steps_XXL = 456;
constexpr float Int_to_Rad_Small = (DEG_TO_RAD * 360) / Pinwheel_Steps_Small; // conversion: from 0...72 to Radians
constexpr float Int_to_Rad_Med = (DEG_TO_RAD * 360) / Pinwheel_Steps_Medium; // conversion: from 0...192 to Radians
constexpr float Int_to_Rad_Big = (DEG_TO_RAD * 360) / Pinwheel_Steps_Big; // conversion: from 0...304 to Radians
constexpr float Int_to_Rad_XL = (DEG_TO_RAD * 360) / Pinwheel_Steps_XL; // conversion: from 0...368 to Radians
constexpr float Int_to_Rad_XXL = (DEG_TO_RAD * 360) / Pinwheel_Steps_XXL; // conversion: from 0...456 to Radians

constexpr int Fixed_Scale = 512; // fixpoint scaling factor (9bit for fraction)

Expand All @@ -825,17 +828,19 @@ static float getPinwheelAngle(int i, int vW, int vH) {
if (maxXY <= Pinwheel_Size_Small) return float(i) * Int_to_Rad_Small;
if (maxXY <= Pinwheel_Size_Medium) return float(i) * Int_to_Rad_Med;
if (maxXY <= Pinwheel_Size_Big) return float(i) * Int_to_Rad_Big;
if (maxXY <= Pinwheel_Size_XL) return float(i) * Int_to_Rad_XL;
// else
return float(i) * Int_to_Rad_XL;
return float(i) * Int_to_Rad_XXL;
}
// Pinwheel helper function: matrix dimensions to number of rays
static int getPinwheelLength(int vW, int vH) {
int maxXY = max(vW, vH);
if (maxXY <= Pinwheel_Size_Small) return Pinwheel_Steps_Small;
if (maxXY <= Pinwheel_Size_Medium) return Pinwheel_Steps_Medium;
if (maxXY <= Pinwheel_Size_Big) return Pinwheel_Steps_Big;
if (maxXY <= Pinwheel_Size_XL) return Pinwheel_Steps_XL;
// else
return Pinwheel_Steps_XL;
return Pinwheel_Steps_XXL;
}
#endif

Expand Down

0 comments on commit b284464

Please sign in to comment.