diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-06-30 11:00:21 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-06-30 11:00:21 +0200 |
| commit | 9c24455a07b6c743239f3301475ad656b702a627 (patch) | |
| tree | dea75223af235c22dcb519ad890406eec406fb50 /checker/src/models/build.sh | |
| parent | 3fbf5317832f3f78918a2cd76e85b9fa3d1af381 (diff) | |
| download | enowars5-service-stldoctor-9c24455a07b6c743239f3301475ad656b702a627.tar.gz enowars5-service-stldoctor-9c24455a07b6c743239f3301475ad656b702a627.zip | |
add new havoc which uploads stl models with real objects in them for fluff
Diffstat (limited to 'checker/src/models/build.sh')
| -rw-r--r-- | checker/src/models/build.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/checker/src/models/build.sh b/checker/src/models/build.sh new file mode 100644 index 0000000..7d41728 --- /dev/null +++ b/checker/src/models/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +gen() { + output=$(openscad --export-format $1 $2 -o $3 2>&1) + if [ $? -ne 0 ]; then + echo "OPENSCAD LOG:" + echo "$output" + exit 1 + fi + size=$(($(cat $3 | wc -c))) + printf "GEN %-20s: " "$3" + if [ $size -ge 50000 ]; then + echo "skipped (too large)" + rm "$3" + else + echo "done" + fi +} + +for fname in $(ls *.scad); do + gen binstl $fname ${fname%.scad}-bin.stl + gen asciistl $fname ${fname%.scad}-ascii.stl +done |
