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.32 by greg, Thu Feb 23 21:28:42 2012 UTC vs.
Revision 2.33 by greg, Tue Mar 6 04:41:31 2012 UTC

# Line 23 | Line 23 | my $geout = 1;
23   my $nproc = 1;
24   my $doforw = 0;
25   my $doback = 1;
26 < my $pctcull = 95;
26 > my $pctcull = 90;
27   my $gunit = "Meter";
28   my @dim;
29   # Get options
# Line 45 | Line 45 | while ($#ARGV >= 0) {
45          } elsif ("$ARGV[0]" =~ /^[-+]b/) {
46                  $doback = ("$ARGV[0]" =~ /^\+/);
47          } elsif ("$ARGV[0]" eq "-t") {
48 +                # Use value < 0 for rttree_reduce bypass
49                  $pctcull = $ARGV[1];
50                  shift @ARGV;
51          } elsif ("$ARGV[0]" =~ /^-t[34]$/) {
# Line 321 | Line 322 | sub bg_tree_rtcontrib {
322   sub ttree_out {
323          my $forw = shift;
324          my $side = ("Back","Front")[$forw];
325 +        my $cmd;
326   # Only output one transmitted distribution, preferring backwards
327   if ( !$forw || !$doback ) {
328   print
# Line 335 | Line 337 | print
337                          <ScatteringDataType>BTDF</ScatteringDataType>
338                          <ScatteringData>
339   ';
340 < system "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
341 <        q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' -of } .
342 <        "$td/" . ($bmodnm,$fmodnm)[$forw] . "_???.flt " .
340 > $cmd = "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
341 >        q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' };
342 > if ($pctcull >= 0) {
343 >        $cmd .= "-of $td/" . ($bmodnm,$fmodnm)[$forw] . "_???.flt " .
344          "| rttree_reduce -a -h -ff -t $pctcull -r $tensortree -g $ttlog2";
345 < die "Failure running rttree_reduce" if ( $? );
345 >        system "$cmd" || die "Failure running rttree_reduce";
346 > } else {
347 >        $cmd .= "$td/" . ($bmodnm,$fmodnm)[$forw] . "_???.flt";
348 >        print "{\n";
349 >        system "$cmd" || die "Failure running rcalc";
350 >        print "}\n";
351 > }
352   print
353   '                       </ScatteringData>
354                  </WavelengthDataBlock>
# Line 361 | Line 370 | print
370                          <ScatteringDataType>BRDF</ScatteringDataType>
371                          <ScatteringData>
372   ';
373 < system "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
374 <        q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' -of } .
375 <        "$td/" . ($fmodnm,$bmodnm)[$forw] . "_???.flt " .
373 > $cmd = "rcalc -if3 -e 'Omega:PI/($ns*$ns)' " .
374 >        q{-e '$1=(0.265*$1+0.670*$2+0.065*$3)/Omega' };
375 > if ($pctcull >= 0) {
376 >        $cmd .= "-of $td/" . ($fmodnm,$bmodnm)[$forw] . "_???.flt " .
377          "| rttree_reduce -a -h -ff -t $pctcull -r $tensortree -g $ttlog2";
378 < die "Failure running rttree_reduce" if ( $? );
378 >        system "$cmd" || die "Failure running rttree_reduce";
379 > } else {
380 >        $cmd .= "$td/" . ($fmodnm,$bmodnm)[$forw] . "_???.flt";
381 >        print "{\n";
382 >        system "$cmd" || die "Failure running rcalc";
383 >        print "}\n";
384 > }
385   print
386   '                       </ScatteringData>
387                  </WavelengthDataBlock>
# Line 636 | Line 652 | print
652                          <ScatteringDataType>BRDF</ScatteringDataType>
653                          <ScatteringData>
654   ';
655 < # Output back reflection (reciprocity averaging)
655 > # Output back reflection (transposed order)
656   for (my $od = 0; $od < $ndiv; $od++) {
657          for (my $id = 0; $id < $ndiv; $id++) {
658                  print $rbarr[$ndiv*$id + $od], ",\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines