Files
BoardGameInlets/.helperHerosKeepOut.sh

57 lines
2.1 KiB
Bash
Executable File

OPENSCAD="openscad"
FOLDER=STL/HeroesKeepOut
mkdir -p STL
mkdir -p $FOLDER
# ── Boxes ─────────────────────────────────────────────────────────────
mkdir -p $FOLDER/Box
echo "Rendering Box-Items..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Items.stl" "./HeroesKeepOut/Box-Items.scad"
"$OPENSCAD" -o "$FOLDER/Box/Box-Items-Lid.stl" "./HeroesKeepOut/Box-Items-Lid.scad"
echo "Rendering Box-Tokens..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Tokens.stl" "./HeroesKeepOut/Box-Tokens.scad"
"$OPENSCAD" -o "$FOLDER/Box/Box-Tokens-Lid.stl" "./HeroesKeepOut/Box-Items-Lid.scad"
echo "Rendering Box-Figures-Heroes..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Heroes.stl" "./HeroesKeepOut/Box-Figure-Heroes.scad"
echo "Rendering Box-Figures-Big..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Big.stl" "./HeroesKeepOut/Box-Figure-Big.scad"
echo "Rendering Box-Figures-Monster-1..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Monster-1.stl" "./HeroesKeepOut/Box-Figure-Monster-1.scad"
SCAD_FILE="./HeroesKeepOut/Box-Figure.scad"
while IFS=',' read -r x y z name; do
# Remove quotes around name, replace spaces with -
label=$(printf '%s' "$name" | sed 's/"//g; s/ /-/g')
output="$FOLDER/Box/Box-Figure-$label.stl"
echo "Rendering $output..."
"$OPENSCAD" \
-D "x=$x" \
-D "y=$y" \
-D "z=$z" \
-D "name=\"$name\"" \
-o "$output" "$SCAD_FILE"
done <./HeroesKeepOut/Box-Figure-Configs.txt
# ── Cards ─────────────────────────────────────────────────────────────
SCAD_FILE="./CardHolder.scad"
mkdir -p $FOLDER/Cards
while IFS=',' read -r b t h name; do
# Remove quotes around name, replace spaces with -
label=$(printf '%s' "$name" | sed 's/"//g; s/ /-/g')
output="$FOLDER/Cards/Cards-$label.stl"
echo "Rendering $output..."
"$OPENSCAD" \
-D "x=$b" \
-D "y=$t" \
-D "z=$h" \
-D "name=\"$name\"" \
-o "$output" "$SCAD_FILE"
done <./HeroesKeepOut/Card-Configs.txt