Back to home page

EIC code displayed by LXR

 
 

    


Warning, /epic/scripts/view3/generate_eps is written in an unsupported language. File is not indexed.

0001 #!/usr/bin/env bash
0002 
0003 echo "view3 produces a series of XY slices  a different z locations."
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="view3"
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 # units are mm
0048 dawncut 0 0 -1 1500 ${INPUT_FILE} ${FILE_TAG}.prim
0049 dawn -d ${FILE_TAG}.prim
0050 ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
0051 gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
0052   -c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
0053   -f ${FILE_TAG}_full.pdf
0054 pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox
0055 
0056 #https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html
0057 # % dawncut a b c d input-file [output-file]
0058 #
0059 #       input-file : Source DAWN-format file describing a 3D scene.
0060 #
0061 #       output-file: Output DAWN-format file describing a plane-clipped
0062 #                    3D scene.  The default output stream is stdout.
0063 #
0064 #       a, b, c, d : Parameters  a, b, c, and d  are double values to
0065 #                    define a clipping plane described with the following
0066 #                    equation:
0067 #
0068 #                       ax + by + cz + d = 0.
0069 #
0070 #                    Vector (a,b,c) defines the normal vector of
0071 #                    the clipping plane.
0072 #                    3D scene data in the half space at the front side
0073 #                    of the clipping plane are clipped out and erased.
0074 #                    The normal vector (a,b,c) needs not be a unit vector.
0075 #                    If it is a unit vector, parameter "d" gives distance
0076 #                    between the clipping plane and origin (0,0,0).