| 12 |
|
set wpsize=(1 1) |
| 13 |
|
set rtargs=(-ab 1 -ad 256 -as 128 -aa .15 -av .1 .1 .1) |
| 14 |
|
|
| 15 |
< |
set maxres=64 |
| 15 |
> |
set maxres=128 |
| 16 |
|
set iltemp=/usr/tmp/il$$.pic |
| 17 |
|
set tempfiles=($iltemp) |
| 18 |
|
|
| 35 |
|
echo "before running this script." |
| 36 |
|
exit 1 |
| 37 |
|
endif |
| 38 |
– |
echo "" |
| 38 |
|
echo "In what scene file is the gensky command located?" |
| 39 |
|
readvar genskyf |
| 40 |
< |
if ( "$genskyf" == "$none" || ! -r "$genskyf" ) then |
| 40 |
> |
if ( "$genskyf" == "$nofile" || ! -r "$genskyf" ) then |
| 41 |
|
echo "You will not be able to compute" |
| 42 |
|
echo "daylight factors without a gensky file" |
| 43 |
|
else |
| 44 |
|
set extamb=`xform -e $genskyf|sed -n 's/^# Ground ambient level: //p'` |
| 45 |
|
endif |
| 46 |
< |
echo "Is the z-axis your zenith direction?" |
| 47 |
< |
if ( "$ans" !~ [yY]* ) then |
| 46 |
> |
echo -n "Is the z-axis your zenith direction? " |
| 47 |
> |
if ( "$<" !~ [yY]* ) then |
| 48 |
|
echo "I'm sorry, you cannot use this script" |
| 49 |
|
exit 1 |
| 50 |
|
endif |
| 52 |
|
readvar wporig |
| 53 |
|
set wporig=($wporig) |
| 54 |
|
echo "What is the x and y size (width and length) of the workplane?" |
| 55 |
< |
read wpsize |
| 55 |
> |
readvar wpsize |
| 56 |
|
set wpsize=($wpsize) |
| 57 |
|
set wpres=(`rcalc -n -e '$1=if(l,'"floor($maxres*$wpsize[1]/$wpsize[2]),$maxres);"'$2=if(l,'"$maxres,floor($maxres*$wpsize[2]/$wpsize[1]));l=$wpsize[2]-$wpsize[1]"`) |
| 58 |
|
set rtargs=($rtargs -ar `getinfo -d<$octree|rcalc -e '$1=floor(16*$4/'"($wpsize[1]+$wpsize[2]))"`) |
| 70 |
|
exit 0 |
| 71 |
|
endif |
| 72 |
|
echo "Starting rtrace calculation -- this will take some time..." |
| 73 |
< |
cnt $wpres | rcalc -e '$1=($1+.5)/'"$wpres[1]*$wpsize[1]+$wporig[1]" \ |
| 74 |
< |
-e '$2=(1-($2+.5)/$wpres[2])*$wpsize[2]+$wporig[2]" \ |
| 75 |
< |
-e '$3='"$wporig[3]" -e "$4=0;$5=0;$6=1" \ |
| 73 |
> |
cnt $wpres[2] $wpres[1] \ |
| 74 |
> |
| rcalc -e '$1=($2+.5)/'"$wpres[1]*$wpsize[1]+$wporig[1]" \ |
| 75 |
> |
-e '$2=(1-($1+.5)/'"$wpres[2])*$wpsize[2]+$wporig[2]" \ |
| 76 |
> |
-e '$3='"$wporig[3]" -e '$4=0;$5=0;$6=1' \ |
| 77 |
|
| rtrace $rtargs -I -ov -faf $octree \ |
| 78 |
|
| pvalue -r -x $wpres[1] -y $wpres[2] -df \ |
| 79 |
< |
| pfilt -h 20 -n 0 -x 512 -y 512 -p 1 -r .7 > $iltemp |
| 79 |
> |
| pfilt -h 20 -n 0 -x 350 -y 350 -p 1 -r 1 > $iltemp |
| 80 |
|
set maxval=`getinfo < $iltemp | rcalc -i 'EXPOSURE=${e}' -e '$1=3/e'` |
| 81 |
|
if ( "$ilpict" != "$nofile" ) then |
| 82 |
|
echo "Making illuminance contour picture $ilpict..." |
| 83 |
< |
falsecolor -s "$maxval*470" -l Lux -log 2 -cl -pi $iltemp > $ilpict |
| 83 |
> |
falsecolor -s "$maxval*470" -m 470 -l Lux -cb -pi $iltemp > $ilpict |
| 84 |
|
endif |
| 85 |
|
if ( "$dfpict" != "$nofile" ) then |
| 86 |
|
echo "Making daylight factor contour picture $dfpict..." |
| 87 |
|
falsecolor -s "$maxval/$extamb" -m "1/$extamb" -l DF \ |
| 88 |
< |
-log 2 -cl -pi $iltemp > $dfpict |
| 88 |
> |
-cb -pi $iltemp > $dfpict |
| 89 |
|
endif |
| 90 |
|
echo "Done." |
| 91 |
|
quit: |