Run admesh form export.sh, die on error

This commit is contained in:
Miro Hrončok 2014-05-09 21:13:30 +02:00
commit f592fe44d4

View file

@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash -xe
if [ $# -ne 2 ]; then
echo "Usage: ./export.sh \$BADGE \$SIZE"
@ -10,16 +10,16 @@ size=$2
# cleanup from our last run
rm -f badge.png badge-shape.png badge.dat badge-shape.dat
rm -f badge.png badge-shape.png badge.dat badge-shape.dat badge.stl
# Kick it off
inkscape --export-png=badge.png --export-width=$size --export-height=$size ../svgs/$badge.svg
inkscape --export-png=badge-shape.png --export-width=$size --export-height=$size ../svgs/badge-shape.svg
python png2heightmap.py badge.png > badge.dat
python png2heightmap.py badge-shape.png > badge-shape.dat
openscad badge.scad -o ../stls/$badge.stl
admesh --write-binary-stl=../stls/badge.stl ../stls/badge.stl
openscad badge.scad -o badge.stl
admesh --translate=0,0,0 --write-binary-stl=../stls/$badge.stl badge.stl
echo "Done with ../stls/$badge.stl"
# and.. cleanup.
rm -f badge.png badge-shape.png badge.dat badge-shape.dat
rm -f badge.png badge-shape.png badge.dat badge-shape.dat badge.stl