--- ray/src/gen/glaze.csh 2004/08/14 19:36:38 2.3 +++ ray/src/gen/glaze.csh 2008/02/11 19:18:25 2.7 @@ -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.7 2008/02/11 19:18:25 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") @@ -29,8 +34,9 @@ set tn_b_arr=(0.886 0.744 0.63 0.21 0.09) # Boolean whether coatings can have partial coverage: set part_arr=(0 0 0 1 1) +set gfiles=() 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 @@ -38,6 +44,7 @@ while ($#argv > 0) shift argv set gf="$argv[1]" shift argv + set gfiles=($gfiles:q $gf:q) if ("`sed -n 1p $gf:q`" != "$header") then echo "Bad header in $gf -- Expected: $header" exit 1 @@ -47,8 +54,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,12 +66,14 @@ 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 +if (! $#gfiles) unset gfiles ################################################################# # @@ -148,7 +157,11 @@ endif echo "" echo "############################################" echo "# Glazing produced by Radiance glaze script" -echo "# `date`" +echo '# $Revision: 2.7 $' +if ($?gfiles) then + echo "# Loaded: $gfiles:q" + echo "# `date`" +endif echo "# Material surface normal points to interior" echo "# Number of panes in system: $np" @@ -212,8 +225,8 @@ endif else ### Low-E glazing echo "10" -echo " sr_lowE_r sr_lowE_g sr_lowE_b" -echo " st_lowE_r st_lowE_g st_lowE_b" +echo " sr_clear_r sr_clear_g sr_clear_b" +echo " st_clear_r st_clear_g st_clear_b" echo " 0 0 0" echo " glaze1.cal" echo "0"