Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tuxilio/ledtree
  • codecraft/ledtree
2 results
Show changes
Commits on Source (2)
-- NUR DURCH 4 TEILBARE ZAHLEN > 20 VERWENDEN!!! -- NUR DURCH 4 TEILBARE ZAHLEN > 20 VERWENDEN!!!
local leds = { local leds = {
64, 40,
56,
48,
36, 36,
32,
24,
20, 20,
16,
12,
8,
4
} }
for i = 1, #leds do for i = 1, #leds do
if leds[i] % 4 ~= 0 then if leds[i] % 4 ~= 0 then
error("[ledtree] led count per layer must be divisible by 4. Error location: 'leds' table, item "..i..": "..leds[i]) error("[ledtree] led count per layer must be divisible by 4. Error location: 'leds' table, item "..i..": "..leds[i])
end end
if leds[i] < 20 then
error("[ledtree] led count per layer must be greater than or qual to 20. Error location: 'leds' table, item "..i..": "..leds[i])
end
end end
local height_increment = 3 local height_increment = 3
...@@ -38,7 +39,7 @@ local function place_layer(center, breite) ...@@ -38,7 +39,7 @@ local function place_layer(center, breite)
breite = breite * 2 + 1 breite = breite * 2 + 1
local needles = {} local needles = {}
local leds = {} local leds = {}
local max_offset = math.floor(breite / 2) local max_offset = (breite - 1) / 2
for y = math.ceil(-height_increment / 2), math.floor(height_increment / 2) do for y = math.ceil(-height_increment / 2), math.floor(height_increment / 2) do
for x = -max_offset, max_offset do for x = -max_offset, max_offset do
for z = -max_offset, max_offset do for z = -max_offset, max_offset do
......