aboutsummaryrefslogtreecommitdiff
path: root/project/scripts/kcl/remove-face-down-roads.txt
diff options
context:
space:
mode:
authorroot <root@dc13.lemmi>2020-07-21 10:00:46 +0200
committerroot <root@dc13.lemmi>2020-07-21 10:00:46 +0200
commit1192c4575ea7afdf38e3fa0df4587a08620af11e (patch)
tree6910a62487c282d0840d2e668aa7eb40b7c8a3fd /project/scripts/kcl/remove-face-down-roads.txt
parent76de8a89f7c1d1b4522eb66e8f89d248e8c1781f (diff)
SZS v2.18a
Diffstat (limited to '')
-rw-r--r--project/scripts/kcl/remove-face-down-roads.txt20
1 files changed, 20 insertions, 0 deletions
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<<type) # if it is a drivable KCL type
+ @def norm = tri$normal(t,0) # get the first normal
+ @if norm.y < 0 # if it is face down
+ @def stat = tri$remove(t) # remove the triangle
+ @def rm_count = rm_count + 1 # incremtent the counter
+ @endif # endif
+ @endif # endif
+@endfor
+
+# print out a summary line
+@echo " - " rm_count " face down road triangles removed in " (mSec()-start) " msec."
+