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.5 by greg, Wed Aug 25 19:13:30 2004 UTC vs.
Revision 2.8 by greg, Thu Nov 5 19:00:50 2009 UTC

# Line 8 | Line 8
8   # Funding for this development generously provided by Visarc, Inc.
9   # (http://www.visarc.com)
10   #
11 + # Nov. 2009 Jack de Valpine - Visarc, Inc.
12 + #     -f option now clears the internal demo database and accepts
13 + #        a clear glass definition as the first entry
14 + #        in the database file
15 + #        
16  
17   #################################################################
18   #
# Line 16 | Line 21
21   # If the user tries to enter two coated surfaces on the same
22   # pane, the script complains and exits.
23   #
24 < # Supported surface types:
24 > # Supported surface types (clear glass prepended below):
25   #
26 < set sn_arr=("clear glass" "VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit")
26 > set sn_arr=("VE1-2M low-E coating" "PVB laminated" "V-175 white frit" "V-933 warm gray frit")
27   # Glass-side hemispherical reflectances for each surface type:
28 < set rg_r_arr=(0.074 0.065 .11 0.33 0.15)
29 < set rg_g_arr=(0.077 0.058 .11 0.33 0.15)
30 < set rg_b_arr=(0.079 0.067 .11 0.33 0.15)
28 > set rg_r_arr=(0.065 .11 0.33 0.15)
29 > set rg_g_arr=(0.058 .11 0.33 0.15)
30 > set rg_b_arr=(0.067 .11 0.33 0.15)
31   # Coating-side hemispherical reflectance for each surface type:
32 < set rc_r_arr=(0.074 0.042 .11 0.59 0.21)
33 < set rc_g_arr=(0.077 0.049 .11 0.59 0.21)
34 < set rc_b_arr=(0.079 0.043 .11 0.59 0.21)
32 > set rc_r_arr=(0.042 .11 0.59 0.21)
33 > set rc_g_arr=(0.049 .11 0.59 0.21)
34 > set rc_b_arr=(0.043 .11 0.59 0.21)
35   # Hemispherical (normal) transmittance for each surface type:
36 < set tn_r_arr=(0.862 0.756 0.63 0.21 0.09)
37 < set tn_g_arr=(0.890 0.808 0.63 0.21 0.09)
38 < set tn_b_arr=(0.886 0.744 0.63 0.21 0.09)
36 > set tn_r_arr=(0.756 0.63 0.21 0.09)
37 > set tn_g_arr=(0.808 0.63 0.21 0.09)
38 > set tn_b_arr=(0.744 0.63 0.21 0.09)
39   # Boolean whether coatings can have partial coverage:
40 < set part_arr=(0 0 0 1 1)
40 > set part_arr=(0 0 1 1)
41  
42 + set gfiles=()
43   while ($#argv > 0)
44          set header="Surface     Tr      Tg      Tb      Rcr     Rcg     Rcb     Rgr     Rgg     Rgb     Part"
45          if ($#argv < 2 || "$argv[1]" != '-f') then
# Line 41 | Line 47 | while ($#argv > 0)
47                  exit 1
48          endif
49          shift argv
50 +        # Clear internal default database
51 +        set sn_arr=()
52 +        set rg_r_arr=() ; set rg_g_arr=() ; set rg_b_arr=()
53 +        set rc_r_arr=() ; set rc_g_arr=() ; set rc_b_arr=()
54 +        set tn_r_arr=() ; set tn_g_arr=() ; set tn_b_arr=()
55 +        set part_arr=()
56          set gf="$argv[1]"
57          shift argv
58 +        set gfiles=($gfiles:q $gf:q)
59          if ("`sed -n 1p $gf:q`" != "$header") then
60                  echo "Bad header in $gf -- Expected: $header"
61                  exit 1
# Line 71 | Line 84 | while ($#argv > 0)
84                  @ i++
85          end
86   end
87 + if (! $#gfiles) then
88 +        unset gfiles
89 +        echo "###"
90 +        echo "### NOTE: Using internal demo database!"
91 +        echo "###"
92 +        echo
93 + endif
94 + #
95 + # Make sure we have a clear glazing definition
96 + #
97 + if (`rcalc -n -e 'ad(a,b)=if(a-b,a-b,b-a);$1=if('"ad($rg_r_arr[1],$rc_r_arr[1])+ad($rg_g_arr[1],$rc_g_arr[1])+ad($rg_b_arr[1],$rc_b_arr[1])-.005,1,0)"`) then
98 +        set sn_arr=("clear glass" $sn_arr:q)
99 +        set rg_r_arr=(0.074 $rg_r_arr)
100 +        set rg_g_arr=(0.077 $rg_g_arr)
101 +        set rg_b_arr=(0.079 $rg_b_arr)
102 +        set rc_r_arr=(0.074 $rc_r_arr)
103 +        set rc_g_arr=(0.077 $rc_g_arr)
104 +        set rc_b_arr=(0.079 $rc_b_arr)
105 +        set tn_r_arr=(0.862 $tn_r_arr)
106 +        set tn_g_arr=(0.890 $tn_g_arr)
107 +        set tn_b_arr=(0.886 $tn_b_arr)
108 +        set part_arr=(0 $part_arr)
109 + endif
110  
111   #################################################################
112   #
# Line 154 | Line 190 | endif
190   echo ""
191   echo "############################################"
192   echo "# Glazing produced by Radiance glaze script"
193 < echo "# `date`"
193 > echo '# $Revision$'
194 > if ($?gfiles) then
195 >        echo "# Loaded: $gfiles:q"
196 >        echo -n "# " ; date
197 > endif
198   echo "# Material surface normal points to interior"
199   echo "# Number of panes in system: $np"
200  
# Line 218 | Line 258 | endif
258   else
259   ### Low-E glazing
260   echo "10"
261 < echo "  sr_lowE_r sr_lowE_g sr_lowE_b"
262 < echo "  st_lowE_r st_lowE_g st_lowE_b"
261 > echo "  sr_clear_r sr_clear_g sr_clear_b"
262 > echo "  st_clear_r st_clear_g st_clear_b"
263   echo "  0 0 0"
264   echo "  glaze1.cal"
265   echo "0"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines