File indexing completed on 2026-04-09 07:49:01
0001
0002 usage(){ cat << EOU
0003 cxr_geochain.sh : 3D renders using CSGOptiXRenderTest
0004 ==========================================================
0005
0006 Rendering CSGFoundry geometry created from
0007 Geant4 C++ solid specification by GeoChain
0008 executable.
0009
0010 Usage:
0011
0012 1. create a CSGFoundry geometry folder by conversion from a Geant4 geometry using GeoChain::
0013
0014 cd ~/opticks/GeoChain
0015 ./translate.sh
0016
0017 2. alternatively some geometry is only implemnented at CSG level, create CSGFoundry with::
0018
0019 cd ~/opticks/CSG
0020 ./CSGMakerTest.sh
0021
0022 3. run the render, this works with OptiX 7 (needs manual b7 build) and also by virtue of CSGOptiX/Six.cc with OptiX 5 or 6::
0023
0024 cd ~/opticks/CSGOptiX
0025
0026 ./cxr_geochain.sh
0027 EYE=0,0,1,1 ./cxr_geochain.sh
0028
0029 The EYE, LOOK, UP envvars set the okc/View::home defaults
0030
0031 DONE: avoid outdir having -1 elem in the path, as thats tedious to handle from shell
0032 DONE: add PUB=1 sensitivity to copy renders into standardized publication dirs based on the outdir
0033 with the front of the path replaced
0034
0035 Taking a look inside, hunting speckle::
0036
0037 EYE=0,-0.7,0. UP=0,0,1 TMIN=0. CAM=0 ./cxr_geochain.sh
0038
0039
0040 Debugging unexpected renders
0041 ------------------------------
0042
0043 1. force recompile the kernels by touching .cu
0044
0045 * have observed that changes to CSG headers do not automatically
0046 trigger rebuilds of the .cu kernels : so touch the .cu to
0047 make sure get the latest CSG headers
0048
0049
0050 Debugging blank renders
0051 ------------------------
0052
0053 Arrange a viewpoint from the inside of a shape such that every pixel should intersect.
0054 Thence can trace whats happening with any pixel.
0055
0056 ::
0057
0058 EYE=0.1,0.1,0.1 ./cxr_geochain.sh
0059 shoot from inside so every pixel should intersect
0060 add debug to trace whats happening
0061
0062
0063 EYE=1,1,1 GEOM=DifferenceBoxSphere TMIN=0.5 ./cxr_geochain.sh
0064
0065
0066 EOU
0067 }
0068
0069 msg="=== $BASH_SOURCE :"
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121 source $PWD/../bin/GEOM.sh trim
0122
0123
0124 if [ "$(uname)" == "Linux" ]; then
0125 cfname=GeoChain/$GEOM
0126 else
0127 cfname=GeoChain_Darwin/$GEOM
0128 fi
0129
0130
0131 moi=ALL
0132 zoom=1
0133
0134 if [ "$GEOM" == "default" ]; then
0135 eye=-1,0,1,1
0136 tmin=0.5
0137 icam=0
0138 elif [ "$GEOM" == "XJfixtureConstruction" ]; then
0139 eye=1,1,1
0140 tmin=0.1
0141 icam=1
0142 zoom=2
0143 else
0144 eye=-2,0,0,1
0145 tmin=1
0146 icam=1
0147 fi
0148
0149 emm=t0
0150
0151 stamp=$(date +"%Y-%m-%d %H:%M")
0152 version=$(CSGOptiXVersion 2>/dev/null)
0153 export MOI=${1:-$moi}
0154 export CFNAME=${CFNAME:-$cfname}
0155 export EMM=${EMM:-$emm}
0156 export TMIN=${TMIN:-$tmin}
0157 export EYE=${EYE:-$eye}
0158 export ICAM=${ICAM:-$icam}
0159 export ZOOM=${ZOOM:-$zoom}
0160
0161
0162 export Camera=INFO
0163
0164 export NAMEPREFIX=cxr_geochain_${GEOM}_
0165 export RELDIR=cxr_geochain/cam_${ICAM}
0166 export TOPLINE="./cxr_geochain.sh $MOI # EYE $EYE $stamp $version $GEOM "
0167
0168 vars="GEOM MOI CFNAME EMM TMIN EYE ICAM NAMEPREFIX RELDIR TOPLINE"
0169 echo $msg
0170 for var in $vars ; do printf "%-20s : %s \n" $var "${!var}" ; done
0171
0172 echo $msg invoke ./cxr.sh
0173 ./cxr.sh
0174
0175 exit 0
0176