Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#!/usr/bin/env bash
set -e
if [[ -z "$1" ]]; then
echo
echo "./scripts/build <size> [<size> [...]] - build composable organizer for given sizes"
echo
echo "Example:"
echo " ./build 2x1x1 3x2x1 3x3x1"
echo
exit 1
fi
OUTPUT_DIR="output"
OUTPUT_EXT="stl"
FILES=( compartment lid tray tray-lid )
if [ -z "$VERSION_STRING" ]; then
VERSION_STRING=$((git rev-parse HEAD || echo "(none)") | cut -c 1-8)
fi
mkdir -p $OUTPUT_DIR
for size in "$@"; do
openscad_size="${size//x/,}"
for file in "${FILES[@]}"; do
echo "building $file with $size..." >&2
cmd="openscad -D '\$fn=100' -D 'version_string=\"$VERSION_STRING\"' -D 'emboss_versions=true' -D 'size=[$openscad_size]' $file.scad -o \"$OUTPUT_DIR/$file-$size.$OUTPUT_EXT\""
echo "$cmd" >&2
echo "$cmd"
done
done | parallel
f01bb2fb5This file is pinned to the selected release. Download the original to open it in your design tool.