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.21 by greg, Wed Jun 8 23:16:47 2011 UTC vs.
Revision 2.22 by greg, Fri Jun 24 00:41:51 2011 UTC

# Line 23 | Line 23 | my $geout = 1;
23   my $nproc = 1;
24   my $doforw = 0;
25   my $doback = 1;
26 + my $gunit = "Meter";
27   my @dim;
28   # Get options
29   while ($#ARGV >= 0) {
# Line 33 | Line 34 | while ($#ARGV >= 0) {
34                  shift @ARGV;
35          } elsif ("$ARGV[0]" =~ /^[-+]g/) {
36                  $geout = ("$ARGV[0]" =~ /^\+/);
37 +                $gunit = $ARGV[1];
38 +                if ($gunit !~ /^(?i)(meter|foot|inch|centimeter|millimeter)$/) {
39 +                        die "Illegal geometry unit '$gunit': must be meter, foot, inch, centimeter, or millimeter\n";
40 +                }
41 +                shift @ARGV;
42          } elsif ("$ARGV[0]" =~ /^[-+]f/) {
43                  $doforw = ("$ARGV[0]" =~ /^\+/);
44          } elsif ("$ARGV[0]" =~ /^[-+]b/) {
# Line 109 | Line 115 | print
115                  <Name>Name</Name>
116                  <Manufacturer>Manufacturer</Manufacturer>
117   ';
118 < printf "\t\t<Thickness unit=\"Meter\">%.3f</Thickness>\n", $dim[5] - $dim[4];
119 < printf "\t\t<Width unit=\"Meter\">%.3f</Width>\n", $dim[1] - $dim[0];
120 < printf "\t\t<Height unit=\"Meter\">%.3f</Height>\n", $dim[3] - $dim[2];
118 > printf "\t\t<Thickness unit=\"$gunit\">%.3f</Thickness>\n", $dim[5] - $dim[4];
119 > printf "\t\t<Width unit=\"$gunit\">%.3f</Width>\n", $dim[1] - $dim[0];
120 > printf "\t\t<Height unit=\"$gunit\">%.3f</Height>\n", $dim[3] - $dim[2];
121   print "\t\t<DeviceType>Integral</DeviceType>\n";
122   # Output MGF description if requested
123   if ( $geout ) {
124 <        print "\t\t<Geometry format=\"MGF\" unit=\"Meter\">\n";
124 >        print "\t\t<Geometry format=\"MGF\" unit=\"$gunit\">\n";
125          printf "xf -t %.6f %.6f 0\n", -($dim[0]+$dim[1])/2, -($dim[2]+$dim[3])/2;
126          open(MGFSCN, "< $mgfscn");
127          while (<MGFSCN>) { print $_; }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines