#! /bin/bash -f # Last edited on 2010-05-31 19:51:53 by stolfilocal # Runs povray on the light gauge figure. # Saves copy of final PNG in the "figs" subdiretory. cmd="${0##*/}" usage="${cmd} {POVNAME} OPTIONS" runargs=("$@") echo '=====================================================================' echo '=== '"${cmd} ${runargs}" if [[ $# -lt 1 ]]; then echo "too few arguments" 1>&2; echo "${usage}" 1>&2; exit 1 fi povname="$1"; shift tooldir=${STOLFIHOME}/posters/tools parminc="parameters.inc" cmtfile="${povname}.comments" # Create the parameter files for inclusion by the .pov file # and by scripts: /bin/rm -f ${parminc} cat < ${parminc} // created by $0 - DO NOT EDIT #declare scene_name = "${scene}" EOF # Create the ".comments" file: /bin/rm -f ${cmtfile} echo "${cmd} ${runargs}" > ${cmtfile} echo "scene ${scene} style ${style}" >> ${cmtfile} # Render the image: ${tooldir}/run-povray-png $* ${povname}.pov # Copy the rendered image to the "out" directory: lastdir="`cat .last`" if [[ -d "${lastdir}/p.png" ]]; then mkdir -p figs cp -p -v "${lastdir}/p.png" figs/${povname}.png else echo "${lastdir}/p.png not found" 1>&2; fi echo '=== END '"${cmd} ${runargs}" echo '====================================================================='