enowars5-service-stldoctor

STL-Analyzing A/D Service for ENOWARS5 in 2021
git clone https://git.sinitax.com/sinitax/enowars5-service-stldoctor
Log | Files | Refs | README | LICENSE | sfeed.txt

build.sh (431B)


      1#!/bin/sh
      2
      3gen() {
      4	output=$(openscad --export-format "$1" "$2" -o "$3" 2>&1)
      5	if [ $? -ne 0 ]; then
      6		echo "OPENSCAD LOG:"
      7		echo "$output"
      8		exit 1
      9	fi
     10	size=$(($(cat "$3" | wc -c)))
     11	printf "GEN %-20s: " "$3"
     12	if [ $size -ge 50000 ]; then
     13		echo "skipped (too large)"
     14		rm "$3"
     15	else
     16		echo "done"
     17	fi
     18}
     19
     20for fname in $(ls *.scad); do
     21	gen binstl $fname ${fname%.scad}-bin.stl
     22	gen asciistl $fname ${fname%.scad}-ascii.stl
     23done