Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:01

0001 #!/bin/bash -l
0002 
0003 msg="=== $BASH_SOURCE :"
0004 
0005 usage(){ cat << EOU
0006 ::
0007 
0008     ./cxr_demo.sh -1    ## MOI=-1 targets CE of entire IAS i0  
0009 
0010     EYE=0,0,1,1 ./cxr_demo.sh -1 
0011 
0012 The EYE, LOOK, UP envvars set the okc/View::home defaults 
0013 
0014 Sometimes necessary to rerun creation of the Demo geometry 
0015 for the choice of GEOMETRY, to get this to work after reboots/cleanups::
0016 
0017    cd ~/CSG
0018    ./CSGDemoTest.sh 
0019 
0020 
0021 TODO: add "meshnames" to demo for name based MOI targetting 
0022 TODO: pick between multiple IAS with midx -1,-2,...
0023 
0024 EOU
0025 }
0026 
0027 #geometry=dcyl
0028 geometry=bssc
0029 #geometry=dbsp
0030 #geometry=parade
0031 #geometry=layered_sphere
0032 #geometry=sphere_containing_grid_of_spheres
0033 #geometry=scaled_box3
0034 
0035 export GEOMETRY=${GEOMETRY:-$geometry}
0036 cfname=CSGDemoTest/$GEOMETRY            # picks the CSGFoundry geometry to load
0037 
0038 if [ "$GEOMETRY" == "parade" ]; then    # geometry specific defaults, maybe overridden by caller scripts
0039    moi=0:0:4                            # what to look at 
0040    eye=-10,0,5,1                        # where to look from 
0041    tmin=0.1
0042    cam=0         
0043 elif [ "$GEOMETRY" == "scaled_box3" ]; then
0044    moi=-1
0045    eye=-1,-1,0.5
0046    tmin=1.1 
0047    #tmin=1.8 
0048    cam=1
0049 elif [ "$GEOMETRY" == "dcyl" -o "$GEOMETRY" == "dbsp"  ]; then
0050    moi=-1                               # -1 entire-IAS default as it applies to any geometry               
0051    eye=-1,-1,1,1                     
0052    tmin=0.5
0053    cam=0         
0054 else
0055    moi=-1                               # -1 entire-IAS default as it applies to any geometry               
0056    eye=-1,0,1,1                         # 45 degree "tray" view 
0057    tmin=1
0058    cam=0         
0059 fi 
0060 
0061 emm=t0    # default to no solid skips with demo geometry 
0062 
0063 stamp=$(date +"%Y-%m-%d %H:%M")
0064 version=$(CSGOptiXVersion 2>/dev/null)
0065 
0066 
0067 export MOI=${1:-$moi}
0068 export CFNAME=${CFNAME:-$cfname}
0069 export EMM=${EMM:-$emm}
0070 export TMIN=${TMIN:-$tmin}
0071 export EYE=${EYE:-$eye}
0072 export CAM=${CAM:-$cam}    # 0:perspective 1:ortho
0073 
0074 export NAMEPREFIX=cxr_demo_${GEOMETRY}_   # MOI is appended by tests/CSGOptiXRender.cc when --solid_label yields no solids
0075 export RELDIR=cxr_demo/cam_${CAM}
0076 export TOPLINE="./cxr_demo.sh $MOI      # EYE $EYE  $stamp  $version $GEOMETRY   " 
0077 
0078 vars="GEOMETRY MOI CFNAME EMM TMIN EYE CAM NAMEPREFIX RELDIR TOPLINE"
0079 echo $msg 
0080 for var in $vars ; do printf "%-20s : %s \n" $var "${!var}" ; done  
0081 
0082 echo $msg invoke ./cxr.sh 
0083 ./cxr.sh 
0084 
0085 exit 0
0086