Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Luanti LED Tree
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codecraft
Luanti LED Tree
Compare revisions
main to 14d2e4a18a1fc9926dd0ed85e156086bab65d38c
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
codecraft/ledtree
Select target project
No results found
14d2e4a18a1fc9926dd0ed85e156086bab65d38c
Select Git revision
Branches
magic-fixes
main
Swap
Target
tuxilio/ledtree
Select target project
tuxilio/ledtree
codecraft/ledtree
2 results
main
Select Git revision
Branches
magic-fixes
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (4)
fix: upper layers not working (probably)
· 7deb695f
codecraft
authored
2 months ago
7deb695f
fix: led numbers
· 738f3459
codecraft
authored
2 months ago
738f3459
fix: led offset
· 6743e3e0
codecraft
authored
2 months ago
6743e3e0
fix: 2
· 14d2e4a1
codecraft
authored
2 months ago
14d2e4a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tree.lua
+10
-8
10 additions, 8 deletions
tree.lua
with
10 additions
and
8 deletions
tree.lua
View file @
14d2e4a1
-- NUR DURCH 4 TEILBARE ZAHLEN > 20 VERWENDEN!!!
local
leds
=
{
64
,
56
,
48
,
40
,
36
,
32
,
28
,
24
,
20
,
16
,
12
,
8
,
4
}
for
i
=
1
,
#
leds
do
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
])
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
local
height_increment
=
3
...
...
@@ -38,7 +40,7 @@ local function place_layer(center, breite)
breite
=
breite
*
2
+
1
local
needles
=
{}
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
x
=
-
max_offset
,
max_offset
do
for
z
=
-
max_offset
,
max_offset
do
...
...
@@ -63,7 +65,7 @@ local function place_leds(led_index, leds)
end
local
function
place_tree
(
pos
)
local
led_index
=
0
local
led_index
=
300
-
22
0
for
index
=
1
,
#
leds
do
local
l
=
leds
[
index
]
local
layer_center
=
vector
.
new
(
pos
.
x
,
pos
.
y
+
index
*
height_increment
-
height_increment
/
2
,
pos
.
z
)
...
...
This diff is collapsed.
Click to expand it.