--- ray/src/gen/glaze.csh 2003/06/30 18:12:24 2.2 +++ ray/src/gen/glaze.csh 2008/02/11 19:13:05 2.6 @@ -1,15 +1,21 @@ #!/bin/csh -f -# RCSid: $Id: glaze.csh,v 2.2 2003/06/30 18:12:24 greg Exp $ +# RCSid: $Id: glaze.csh,v 2.6 2008/02/11 19:13:05 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") @@ -28,6 +34,47 @@ 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 Part" + if ($#argv < 2 || "$argv[1]" != '-f') then + echo "Usage: $0 [-f glazing.dat ..]" + exit 1 + endif + 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 + endif + echo "Adding glazing types from file $gf :" + set nl=`wc -l < $gf:q` + @ i=2 + while ($i <= $nl) + set ln=(`sed -n ${i}p $gf:q`) + if ($#ln != 11) then + echo "Expected 11 words in line: $ln" + exit 1 + endif + echo $ln[1] + set sn_arr=($sn_arr:q $ln[1]) + set tn_r_arr=($tn_r_arr $ln[2]) + set tn_g_arr=($tn_g_arr $ln[3]) + set tn_b_arr=($tn_b_arr $ln[4]) + 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=($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 + ################################################################# # # Get user input @@ -110,7 +157,11 @@ endif echo "" echo "############################################" echo "# Glazing produced by Radiance glaze script" -echo "# `date`" +echo '# $Revision: 2.6 $ $Date: 2008/02/11 19:13:05 $' +if ($?gfiles) then + echo "# Loaded: $gfiles:q" + echo "# `date`" +endif echo "# Material surface normal points to interior" echo "# Number of panes in system: $np"