3d-printing/scripts/generate-previews.sh
Felipe M. e843c23de1
Add gridfinity-box-label model and shared decoration library
Introduces a new flat, chamfered label sized for Gridfinity storage box
lids, sharing the same Text/Symbol API as gridfinity-bin-label so both
labels draw from one icon catalogue. Symbol shapes, alignment math, and
text/symbol primitives now live in lib/label-decorations.scad and are
consumed by both labels via `use`. label_text gained \n-driven multi-line
support with a configurable line-spacing factor. STL/preview scripts
skip lib/ since it has no top-level geometry.
2026-05-05 22:25:01 +02:00

21 lines
606 B
Shell
Executable file

#!/usr/bin/env bash
set -euo pipefail
IMGSIZE="1280,960"
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
if ! command -v openscad &>/dev/null; then
echo "Error: openscad not found in PATH" >&2
exit 1
fi
count=0
while IFS= read -r -d '' scad_file; do
dir="$(dirname "$scad_file")"
output="${dir}/preview.png"
echo "Rendering ${scad_file} -> ${output}"
openscad --render --autocenter --viewall --imgsize "$IMGSIZE" -o "$output" "$scad_file"
count=$((count + 1))
done < <(find "$REPO_DIR" -name '*.scad' -not -path "$REPO_DIR/lib/*" -print0)
echo "Generated ${count} preview(s)."