28 lines
657 B
Bash
28 lines
657 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
openscad="$(which openscad)"
|
||
|
|
||
|
if [[ $? -gt 0 && "$(uname)" == "Darwin" ]]; then
|
||
|
openscad="/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"
|
||
|
fi
|
||
|
|
||
|
test -x "$openscad" || {
|
||
|
echo "OpenSCAD not found in PATH not in /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
OUTDIR="./out"
|
||
|
test -d "$OUTDIR" || mkdir -p "$OUTDIR"
|
||
|
|
||
|
if [[ $# == 0 ]]; then
|
||
|
echo "Usage: $0 <name> [more names...]"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
while [[ $# -gt 0 ]]; do
|
||
|
name="$1"
|
||
|
shift
|
||
|
"$openscad" -o "$OUTDIR/${name}_text.stl" -D "name=\"$name\"" -D "part=2" "AuerNameTag.scad"
|
||
|
"$openscad" -o "$OUTDIR/${name}_base.stl" -D "name=\"$name\"" -D "part=1" "AuerNameTag.scad"
|
||
|
done
|