Warning, /epic/scripts/view1/generate_eps is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env bash
0002
0003 #export DAWN_PS_PREVIEWER="derp"
0004
0005 function print_the_help {
0006 echo "USAGE: $0 <PRIM_FILE> "
0007 echo " OPTIONS: "
0008 echo " -t,--tag filename tag (default: view1)"
0009 exit
0010 }
0011
0012 FILE_TAG="view01"
0013 INPUT_FILE="../../g4_0000.prim"
0014
0015
0016 POSITIONAL=()
0017 while [[ $# -gt 0 ]]
0018 do
0019 key="$1"
0020
0021 case $key in
0022 -h|--help)
0023 shift # past argument
0024 print_the_help
0025 ;;
0026 -t|--tag)
0027 FILE_TAG="$2"
0028 shift # past argument
0029 shift # past value
0030 ;;
0031 -i|--input)
0032 INPUT_FILE="$2"
0033 shift # past argument
0034 shift # past value
0035 ;;
0036 *) # unknown option
0037 #POSITIONAL+=("$1") # save it in an array for later
0038 echo "unknown option $1"
0039 print_the_help
0040 shift # past argument
0041 ;;
0042 esac
0043 done
0044 set -- "${POSITIONAL[@]}" # restore positional parameters
0045
0046
0047 # Side view (lines)
0048 dawncut -1 0 0 1 ${INPUT_FILE} ${FILE_TAG}.prim
0049 # dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
0050 # dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
0051 ../../bin/dawn_tweak --mag 10 --draw 3 --theta 165 --phi 75 --light-theta 180 --light-phi 90
0052
0053 dawn -d ${FILE_TAG}.prim
0054 ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
0055 gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
0056 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0057 -f ${FILE_TAG}_full.pdf
0058
0059 pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox -thinlinemode solid -aaVector yes -r 600
0060
0061 # Top view
0062 #dawncut 0 -1 0 1 ${INPUT_FILE} ${FILE_TAG}.prim
0063 dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
0064 dawncut 0 -1 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
0065 ../../bin/dawn_tweak --mag 10 --draw 1 --theta 90 --phi 90
0066 dawn -d ${FILE_TAG}.prim
0067 ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_top_full.pdf
0068 gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \
0069 -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
0070 -f ${FILE_TAG}_top_full.pdf
0071
0072 pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox -thinlinemode solid -aaVector yes