ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/genBSDF.pl
(Generate patch)

Comparing ray/src/util/genBSDF.pl (file contents):
Revision 2.40 by greg, Sat Oct 13 20:15:43 2012 UTC vs.
Revision 2.46 by greg, Mon Apr 7 21:33:25 2014 UTC

# Line 24 | Line 24 | my $nproc = 1;
24   my $doforw = 0;
25   my $doback = 1;
26   my $pctcull = 90;
27 < my $gunit = "Meter";
27 > my $gunit = "meter";
28   my @dim;
29   # Get options
30   while ($#ARGV >= 0) {
# Line 129 | Line 129 | if ( $geout ) {
129          while (<MGFSCN>) { print $_; }
130          close MGFSCN;
131          print "xf\n";
132 <        print "\t\t</MGFblock>\n";
132 >        print "</MGFblock>\n";
133          print "\t</Geometry>\n";
134   }
135   # Set up surface sampling
136 < my $nx = int(sqrt($nsamp*($dim[1]-$dim[0])/($dim[3]-$dim[2])) + .5);
137 < my $ny = int($nsamp/$nx + .5);
136 > my $nx = int(sqrt($nsamp*($dim[1]-$dim[0])/($dim[3]-$dim[2])) + 1);
137 > my $ny = int($nsamp/$nx + 1);
138   $nsamp = $nx * $ny;
139   my $ns = 2**$ttlog2;
140   my (@pdiv, $disk2sq, $sq2disk, $tcal, $kcal);
# Line 181 | Line 181 | $disk2sq = '
181   norm_radians(p) : if(-p - PI/4, p + 2*PI, p);
182   in_disk_r = .999995*sqrt(Dx*Dx + Dy*Dy);
183   in_disk_phi = norm_radians(atan2(Dy, Dx));
184 < in_disk_rgn = floor((in_disk_phi + PI/4)/(PI/2)) + 1;
184 > in_disk_rgn = floor((.999995*in_disk_phi + PI/4)/(PI/2)) + 1;
185   out_square_a = select(in_disk_rgn,
186                          in_disk_r,
187                          (PI/2 - in_disk_phi)*in_disk_r/(PI/4),
# Line 277 | Line 277 | $cmd = "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
277          q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' };
278   if ($pctcull >= 0) {
279          $cmd .= "-of $td/" . ($bmodnm,$fmodnm)[$forw] . ".flt " .
280 <        "| rttree_reduce -a -h -ff -t $pctcull -r $tensortree -g $ttlog2";
280 >        "| rttree_reduce -h -ff -t $pctcull -r $tensortree -g $ttlog2";
281 >        $cmd .= " -a" if ($tensortree == 3);
282          system "$cmd" || die "Failure running rttree_reduce";
283   } else {
284          $cmd .= "$td/" . ($bmodnm,$fmodnm)[$forw] . ".flt";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines