File indexing completed on 2026-04-09 07:49:01
0001
0002 usage(){ cat << EOU
0003 cxs_geochain.sh : CenterExtentGensteps onto GeoChain GPU geometry using CSGOptiXSimtraceTest with OptiX 7
0004 =============================================================================================================
0005
0006 NB remember that must run BOTH : "oo" followed by "b7" (or the just now added "oo7") to rebuild
0007
0008 NOMASK=1 ./cxs_geochain.sh
0009 use NOMASK to debug empty frames, eg when the genstep grid is too small for the geometry
0010
0011 SIM=1 ./cxs_geochain.sh
0012 use pvplt_simple for debugging
0013
0014 MASK=t GEOM=AltXJfixtureConstruction_XYZ ./cxs_geochain.sh
0015 3D pyvista view of intersects
0016
0017 GEOM=AltXJfixtureConstruction_XY ./cxs_geochain.sh
0018
0019
0020 Local-Remote development
0021 -------------------------
0022
0023 On laptop configure the GeoChain geometry to use and scp that config to remote::
0024
0025 geom
0026 geom scp
0027
0028 On remote GPU workstation, create the CSGFoundry geometry if not already done::
0029
0030 gc
0031 ./translate.sh
0032
0033 On remote GPU workstation, run this cxs_geochain.sh script which runs the CSGOptiXSimtraceTest executable, with::
0034
0035 cx
0036 ./cxs_geochain.sh
0037
0038 Grab outputs from remote GPU workstation to laptop for analysis::
0039
0040 cx
0041 ./tmp_grab.sh
0042 ./cxs_geochain.sh lrun
0043
0044 Edit code on laptop and then scp to remote working copy without committing::
0045
0046 ~/opticks/bin/git.py put
0047 ~/opticks/bin/git.py put | sh
0048
0049
0050
0051
0052 On remote GPU workstation::
0053
0054
0055
0056 At appropriate junctures "git commit/push" on laptop, and
0057 use "git checkout ." on remote to clean working copy of all changes before "git pull"
0058 to avoid merging.
0059
0060 EOU
0061 }
0062
0063
0064 source $PWD/../bin/GEOM.sh
0065
0066
0067 msg="=== $BASH_SOURCE :"
0068
0069
0070 moi=0
0071 dx=0
0072 dy=0
0073 dz=0
0074 num_pho=100
0075 isel=0
0076 gridscale=0.1
0077 ce_offset=0
0078 ce_scale=1
0079 gsplot=1
0080
0081
0082 dcyl(){ gridscale=0.025 ; }
0083 bssc(){ gridscale=0.025 ; }
0084 Annulus(){ gridscale=0.15 ; }
0085 default(){ echo -n ; }
0086
0087 pmt_default()
0088 {
0089
0090 dz=-4
0091 isel=
0092 unset CXS_OVERRIDE_CE
0093 export CXS_OVERRIDE_CE=0:0:-130:320
0094 }
0095
0096 gcn=${GEOM%%_*}
0097
0098 case $GEOM in
0099 dcyl_*) cfbase=$TMP/CSGDemoTest/$gcn && dcyl ;;
0100 bssc_*) cfbase=$TMP/CSGDemoTest/$gcn && bssc ;;
0101 Annulus*) cfbase=$TMP/GeoChain/$gcn && Annulus ;;
0102 *) cfbase=$TMP/GeoChain/$gcn && default ;;
0103 esac
0104
0105 case $GEOM in
0106 bssc_XZ) note="HMM : box minus sub-sub cylinder NOT showing the spurious intersects, maybe nice round demo numbers effect" ;;
0107 AnnulusBoxUnion_YZ) note="no spurious intersects seen" ;;
0108 AnnulusBoxUnion_XY) note="no spurious intersects seen" ;;
0109 AnnulusTwoBoxUnion_XY) note="no spurious intersects seen" ;;
0110 AnnulusTwoBoxUnion_YZ) note="no spurious" ;;
0111 AnnulusFourBoxUnion_XY) note="spurious intersects appear with four boxes, not with two" ;;
0112 AnnulusFourBoxUnion_YZ) note="curious the spurious intersects visible in XY cross-section are not apparent in YZ cross-section" ;;
0113 AnnulusOtherTwoBoxUnion_XY) note="no spurious intersects seen" ;;
0114 AnnulusOtherTwoBoxUnion_XZ) note="no spurious intersects seen" ;;
0115 AltXJfixtureConstruction_YZ) note="spurious intersects in YZ plane avoided with the Alt CSG modelling" ;;
0116 AltXJfixtureConstruction_XZ) note="thin xbox cross piece apparent" ;;
0117 AltXJfixtureConstruction_XY) note="some spurious remain between the curve of the outer tubs and the protruding boxes" ;;
0118 esac
0119
0120 case $GEOM in
0121 *_XZ) cegs=16:0:9:$dx:$dy:$dz:$num_pho ;;
0122 *_YZ) cegs=0:16:9:$dx:$dy:$dz:$num_pho ;;
0123 *_XY) cegs=16:9:0:$dx:$dy:$dz:$num_pho ;;
0124 *_ZX) cegs=9:0:16:$dx:$dy:$dz:$num_pho ;;
0125 *_ZY) cegs=0:9:16:$dx:$dy:$dz:$num_pho ;;
0126 *_YX) cegs=9:16:0:$dx:$dy:$dz:$num_pho ;;
0127 *_XYZ) cegs=9:16:9:$dx:$dy:$dz:$num_pho ;;
0128 esac
0129
0130
0131 echo $msg GEOM $GEOM gcn $gcn cegs $cegs cfbase $cfbase
0132
0133 source ./cxs.sh
0134
0135