Added example script hashing for optimized image generation.

This commit is contained in:
Revar Desmera
2019-06-01 17:09:17 -07:00
parent 0733eb7e34
commit 751cc1b0c8
2 changed files with 56 additions and 25 deletions

View File

@@ -1,7 +1,18 @@
#!/bin/bash
if [[ $# > 0 ]]; then
PREVIEW_LIBS="$@"
FORCED=""
IMGGEN=""
FILES=""
for opt in "$@" ; do
case $opt in
-f ) FORCED=$opt ;;
-i ) IMGGEN=$opt ;;
* ) FILES="$FILES $opt" ;;
esac
done
if [[ "$FILES" != "" ]]; then
PREVIEW_LIBS="$FILES"
else
PREVIEW_LIBS="common errors attachments math arrays vectors affine coords geometry triangulation quaternions hull constants edges transforms primitives shapes masks shapes2d paths beziers roundcorners walls metric_screws threading involute_gears sliders joiners linear_bearings nema_steppers wiring phillips_drive torx_drive polyhedra debug"
fi
@@ -18,10 +29,11 @@ rm -f tmpscad*.scad
for lib in $PREVIEW_LIBS; do
lib="$(basename $lib .scad)"
mkdir -p images/$lib
rm -f images/$lib/*.png images/$lib/*.gif
# echo ../scripts/docs_gen.py ../$lib.scad -o $lib.scad.md -c -i -I images/$lib/
if [ "$IMGGEN" = "-i" ]; then
rm -f images/$lib/*.png images/$lib/*.gif
fi
echo "$lib.scad"
../scripts/docs_gen.py ../$lib.scad -o $lib.scad.md -c -i -I images/$lib/ || exit 1
../scripts/docs_gen.py ../$lib.scad -o $lib.scad.md -c $IMGGEN $FORCED -I images/$lib/ || exit 1
open -a Typora $lib.scad.md
done