make more customizable
This commit is contained in:
parent
76550363b3
commit
60444e3584
1 changed files with 29 additions and 0 deletions
29
generate.zsh
Executable file
29
generate.zsh
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
zparseopts -D -E -tabs:=tabs -vertical=vertical
|
||||||
|
|
||||||
|
tabs=${tabs[2]:-4}
|
||||||
|
index=0
|
||||||
|
|
||||||
|
scad_args=(
|
||||||
|
-D "icon=\"$icon\""
|
||||||
|
-D "index=$index"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ $vertical ]]; then
|
||||||
|
scad_args+=(-D "vertical=87.0" -D "horizontal=61.0")
|
||||||
|
out_basedir=generated/vertical
|
||||||
|
else
|
||||||
|
out_basedir=generated/horizontal
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d $1 ]]; then
|
||||||
|
echo "Usage: $0 <path-to-icon-dir> [--tabs <number-of-tabs>]"
|
||||||
|
fi
|
||||||
|
for icon in $1/*.svg; do
|
||||||
|
target=$out_basedir/${${icon#*/}:r}.3mf
|
||||||
|
mkdir -p ${target:h}
|
||||||
|
echo "Generating card $icon with tab index $index"
|
||||||
|
colorscad -o $target -i divider.scad -- ${scad_args[@]}
|
||||||
|
(( index = (index + 1) % tabs ))
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue