scad/generate_lighthouse.sh

44 lines
566 B
Bash
Raw Permalink Normal View History

2024-12-14 21:49:49 +01:00
#!/bin/sh
# usage: generate_bottle_tag.sh NAME
set -u
VERSION=0.1
FN=360
# usage: render LAYER PART
render() {
case "$2" in
layer)
CONNECTOR=false
;;
connector)
CONNECTOR=true
;;
*)
echo 'fatal: invalid part' >&2
exit 1
;;
esac
echo rendering "$1" "$2"
openscad \
-D "\$fn=${FN}" \
-D "CONNECTOR=${CONNECTOR}" \
-D "LAYER=$1" \
-o "stls/lighthouse-${2}${1}-v${VERSION}.stl" \
lighthouse.scad
}
cd "$(dirname $0)"
for LAYER in 1 2 3 4;
do
for PART in layer connector
do
render "$LAYER" "$PART"
sleep 1
done
done