From 1192c4575ea7afdf38e3fa0df4587a08620af11e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Jul 2020 10:00:46 +0200 Subject: SZS v2.18a --- project/scripts/kcl/lower-walls.txt | 41 ++++++++++++++++++++++++++ project/scripts/kcl/minimap.txt | 17 +++++++++++ project/scripts/kcl/remove-face-down-roads.txt | 20 +++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 project/scripts/kcl/lower-walls.txt create mode 100644 project/scripts/kcl/minimap.txt create mode 100644 project/scripts/kcl/remove-face-down-roads.txt (limited to 'project/scripts/kcl') diff --git a/project/scripts/kcl/lower-walls.txt b/project/scripts/kcl/lower-walls.txt new file mode 100644 index 0000000..6ec281d --- /dev/null +++ b/project/scripts/kcl/lower-walls.txt @@ -0,0 +1,41 @@ +############################### +### (c) Wiimm, 2015-12-18 ### +############################### + +# Setup +@def start = mSec() # start time, for the status line +@def mod_count = 0 # modification counter + +# Get the value for lowering the walls. +# If 'lower' is defined as number by option --const => use it. +# Otherwise use the default of 30. +@def lower = isNumeric(lower) ? lower : 30 + +# Limit to walls with inclination <45 degree +# If 'degree' is defined by option --const as number >0 => use it. +# Otherwise use the default of 45 degrees. +@def degree = isNumeric(degree) && degree > 0 ? degree : 45 +@def sin_degree = sin(degree) + +# Define a function to test the KCL flag for walls +@function isWall # flag + @pdef t = $1 & 0x1f + @return t == 0x0c || t == 0x0d || t == 0x0f || t == 0x14 || t == 0x1e || t == 0x1f +@endfunction + +# Main loop: Iterate through all triangles +@for t=0;tri$n()-1 + @if isWall(tri$flag(t)) + @def norm = tri$normal(t,0) # get the first normal + @if abs(norm.y) < sin_degree + # it's a vertical wall -> lower the wall & increment counter + @def status = tri$shift(t,-vy(lower)) + @def mod_count = mod_count+1 + @endif + @endif +@endfor + +# Print a little status line +@echo " - " mod_count " of " tri$n() " triangles lowered by " lower + > " in " (mSec()-start) " msec." + diff --git a/project/scripts/kcl/minimap.txt b/project/scripts/kcl/minimap.txt new file mode 100644 index 0000000..a79ac08 --- /dev/null +++ b/project/scripts/kcl/minimap.txt @@ -0,0 +1,17 @@ + +@def start = mSec() # start time +@def mod_count = 0 # modification counter + +@function isRoad # flag + @pdef t = $1 & 0x1f + @return t <= 0x05 || t == 0x17 || t == 0x1d +@endfunction + +@for t=0;tri$n()-1 + @if !isRoad(tri$flag(t,2)) + @def status = tri$remove(t) + @endif +@endfor + +@echo " - " mod_count " of " tri$n() " triangles lowered in " (mSec()-start) " msec." + diff --git a/project/scripts/kcl/remove-face-down-roads.txt b/project/scripts/kcl/remove-face-down-roads.txt new file mode 100644 index 0000000..e21bddf --- /dev/null +++ b/project/scripts/kcl/remove-face-down-roads.txt @@ -0,0 +1,20 @@ + +#--- remove face down roads + +@def start = mSec() # start time, for the status line +@def rm_count = 0 # reset status counter + +@for t=0; tri$n()-1 # for each tirangle (index 0 based) + @pdef type = tri$flag(t) & 0x1f # get the KCL type + @if kcl$drive & (1<