-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·37 lines (30 loc) · 1007 Bytes
/
make.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
openscad="$(which openscad)"
colorscad="${COLORSCAD:-$(which colorscad.sh)}"
use_colorscad=false
test -x "$colorscad" && use_colorscad=true
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
echo -n generating for "$name"
if [[ "$use_colorscad" == "true" ]]; then
"$colorscad" -i "AuerNameTag.scad" -o "$OUTDIR/${name}.3mf" -- -D "name=\"$name\"" -D "part=4" &>/dev/null &
fi
"$openscad" -o "$OUTDIR/${name}_text.stl" -D "name=\"$name\"" -D "part=2" "AuerNameTag.scad" &>/dev/null &
"$openscad" -o "$OUTDIR/${name}_base.stl" -D "name=\"$name\"" -D "part=1" "AuerNameTag.scad" &>/dev/null &
wait
echo " done"
done