--- ray/src/gen/glaze.csh 2004/08/14 19:36:38 2.3 +++ ray/src/gen/glaze.csh 2004/08/25 19:13:30 2.5 @@ -1,16 +1,21 @@ #!/bin/csh -f -# RCSid: $Id: glaze.csh,v 2.3 2004/08/14 19:36:38 greg Exp $ +# RCSid: $Id: glaze.csh,v 2.5 2004/08/25 19:13:30 greg Exp $ # # Complex glazing model (goes with glaze1.cal and glaze2.cal) # # Oct. 2002 Greg Ward # Aug. 2004 GW (added -f option to read glazings from file) # Funding for this development generously provided by Visarc, Inc. -# (http://www.vizarc.com) +# (http://www.visarc.com) # ################################################################# # +# The general assumption is that one surface is uncoated, and +# reflectances and transmittances are computed from this fact. +# If the user tries to enter two coated surfaces on the same +# pane, the script complains and exits. +# # Supported surface types: # set sn_arr=("clear glass" "VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit") @@ -30,7 +35,7 @@ set tn_b_arr=(0.886 0.744 0.63 0.21 0.09) set part_arr=(0 0 0 1 1) while ($#argv > 0) - set header="Surface Tr Tg Tb Rcr Rcg Rcb Rgr Rgg Rgb" + set header="Surface Tr Tg Tb Rcr Rcg Rcb Rgr Rgg Rgb Part" if ($#argv < 2 || "$argv[1]" != '-f') then echo "Usage: $0 [-f glazing.dat ..]" exit 1 @@ -47,8 +52,8 @@ while ($#argv > 0) @ i=2 while ($i <= $nl) set ln=(`sed -n ${i}p $gf:q`) - if ($#ln != 10) then - echo "Expected 10 words in line: $ln" + if ($#ln != 11) then + echo "Expected 11 words in line: $ln" exit 1 endif echo $ln[1] @@ -59,9 +64,10 @@ while ($#argv > 0) set rc_r_arr=($rc_r_arr $ln[5]) set rc_g_arr=($rc_g_arr $ln[6]) set rc_b_arr=($rc_b_arr $ln[7]) - set rg_r_arr=($rc_r_arr $ln[8]) - set rg_g_arr=($rc_g_arr $ln[9]) - set rg_b_arr=($rc_b_arr $ln[10]) + set rg_r_arr=($rg_r_arr $ln[8]) + set rg_g_arr=($rg_g_arr $ln[9]) + set rg_b_arr=($rg_b_arr $ln[10]) + set part_arr=($part_arr $ln[11]) @ i++ end end