ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/glaze.csh
(Generate patch)

Comparing ray/src/gen/glaze.csh (file contents):
Revision 2.2 by greg, Mon Jun 30 18:12:24 2003 UTC vs.
Revision 2.5 by greg, Wed Aug 25 19:13:30 2004 UTC

# Line 4 | Line 4
4   # Complex glazing model (goes with glaze1.cal and glaze2.cal)
5   #
6   # Oct. 2002 Greg Ward
7 + # Aug. 2004 GW (added -f option to read glazings from file)
8   # Funding for this development generously provided by Visarc, Inc.
9 < # (http://www.vizarc.com)
9 > # (http://www.visarc.com)
10   #
11  
12   #################################################################
13   #
14 + # The general assumption is that one surface is uncoated, and
15 + # reflectances and transmittances are computed from this fact.
16 + # If the user tries to enter two coated surfaces on the same
17 + # pane, the script complains and exits.
18 + #
19   # Supported surface types:
20   #
21   set sn_arr=("clear glass" "VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit")
# Line 27 | Line 33 | set tn_g_arr=(0.890 0.808 0.63 0.21 0.09)
33   set tn_b_arr=(0.886 0.744 0.63 0.21 0.09)
34   # Boolean whether coatings can have partial coverage:
35   set part_arr=(0 0 0 1 1)
36 +
37 + while ($#argv > 0)
38 +        set header="Surface     Tr      Tg      Tb      Rcr     Rcg     Rcb     Rgr     Rgg     Rgb     Part"
39 +        if ($#argv < 2 || "$argv[1]" != '-f') then
40 +                echo "Usage: $0 [-f glazing.dat ..]"
41 +                exit 1
42 +        endif
43 +        shift argv
44 +        set gf="$argv[1]"
45 +        shift argv
46 +        if ("`sed -n 1p $gf:q`" != "$header") then
47 +                echo "Bad header in $gf -- Expected: $header"
48 +                exit 1
49 +        endif
50 +        echo "Adding glazing types from file $gf :"
51 +        set nl=`wc -l < $gf:q`
52 +        @ i=2
53 +        while ($i <= $nl)
54 +                set ln=(`sed -n ${i}p $gf:q`)
55 +                if ($#ln != 11) then
56 +                        echo "Expected 11 words in line: $ln"
57 +                        exit 1
58 +                endif
59 +                echo $ln[1]
60 +                set sn_arr=($sn_arr:q $ln[1])
61 +                set tn_r_arr=($tn_r_arr $ln[2])
62 +                set tn_g_arr=($tn_g_arr $ln[3])
63 +                set tn_b_arr=($tn_b_arr $ln[4])
64 +                set rc_r_arr=($rc_r_arr $ln[5])
65 +                set rc_g_arr=($rc_g_arr $ln[6])
66 +                set rc_b_arr=($rc_b_arr $ln[7])
67 +                set rg_r_arr=($rg_r_arr $ln[8])
68 +                set rg_g_arr=($rg_g_arr $ln[9])
69 +                set rg_b_arr=($rg_b_arr $ln[10])
70 +                set part_arr=($part_arr $ln[11])
71 +                @ i++
72 +        end
73 + end
74  
75   #################################################################
76   #

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines