| 189 |
|
my $CIEuv = 'Xi=.5141*Ri+.3239*Gi+.1620*Bi;' . |
| 190 |
|
'Yi=.2651*Ri+.6701*Gi+.0648*Bi;' . |
| 191 |
|
'Zi=.0241*Ri+.1229*Gi+.8530*Bi;' . |
| 192 |
< |
'den=Xi+15*Yi+3*Zi+1e-9;' . |
| 193 |
< |
'uprime=4*Xi/den;vprime=9*Yi/den;' ; |
| 192 |
> |
'den=Xi+15*Yi+3*Zi;' . |
| 193 |
> |
'uprime=if(Yi,4*Xi/den,4/19);' . |
| 194 |
> |
'vprime=if(Yi,9*Yi/den,9/19);' ; |
| 195 |
|
my $FEPS = 1e-5; |
| 196 |
|
my $ns = 2**$ttlog2; |
| 197 |
|
my $nx = int(sqrt($nsamp*($dim[1]-$dim[0])/($dim[3]-$dim[2])) + 1); |
| 205 |
|
} |
| 206 |
|
close MYAVH; |
| 207 |
|
# Generate octree |
| 208 |
< |
system "oconv -w -f $radscn > $octree"; |
| 208 |
> |
system "oconv -w $radscn > $octree"; |
| 209 |
|
die "Could not compile scene\n" if ( $? ); |
| 210 |
|
# Add MGF description if requested |
| 211 |
|
if ( $geout ) { |
| 213 |
|
printf MGFSCN "xf -t %.6f %.6f 0\n", -($dim[0]+$dim[1])/2, -($dim[2]+$dim[3])/2; |
| 214 |
|
close MGFSCN; |
| 215 |
|
if ( $mgfin ) { |
| 216 |
+ |
die "+mgf requires input file with +geom\n" if ($#ARGV < 0); |
| 217 |
|
system qq{mgfilt "#,o,xf,c,cxy,cspec,cmix,m,sides,rd,td,rs,ts,ir,v,p,n,f,fh,sph,cyl,cone,prism,ring,torus" @ARGV >> $mgfscn}; |
| 218 |
|
} else { |
| 219 |
|
system "rad2mgf $radscn >> $mgfscn"; |
| 324 |
|
qq{| rcalc -e "r1=rand(.8681*recno-.673892)" } . |
| 325 |
|
qq{-e "r2=rand(-5.37138*recno+67.1737811)" } . |
| 326 |
|
qq{-e "r3=rand(+3.17603772*recno+83.766771)" } . |
| 327 |
< |
qq{-e "Dx=1-2*(\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)" } . |
| 327 |
> |
qq{-e "r4=rand(-1.5839226*recno-59.82712)" } . |
| 328 |
> |
qq{-e "odds(n):if(.5*n-floor(.5*n)-.25,-1,1)"} . |
| 329 |
> |
qq{-e "Dx=1-(\$1+r1)/$ns2" } . |
| 330 |
> |
qq{-e "Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2" } . |
| 331 |
> |
qq{-e "Dz=sqrt(1-Dx*Dx-Dy*Dy)" } . |
| 332 |
|
qq{-e "xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]" } . |
| 333 |
|
qq{-e "yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]" } . |
| 334 |
|
qq{-e "zp=$dim[5-$forw]" -e "myDz=Dz*($forw*2-1)" } . |
| 340 |
|
qq{| rcalc -e 'r1=rand(.8681*recno-.673892)' } . |
| 341 |
|
qq{-e 'r2=rand(-5.37138*recno+67.1737811)' } . |
| 342 |
|
qq{-e 'r3=rand(+3.17603772*recno+83.766771)' } . |
| 343 |
< |
qq{-e 'Dx=1-2*(\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)' } . |
| 344 |
< |
qq{-e 'xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]' } . |
| 345 |
< |
qq{-e 'yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]' } . |
| 343 |
> |
qq{-e 'r4=rand(-1.5839226*recno-59.82712)' } . |
| 344 |
> |
qq{-e 'odds(n):if(.5*n-floor(.5*n)-.25,-1,1)' } . |
| 345 |
> |
qq{-e 'Dx=1-(\$1+r1)/$ns2' } . |
| 346 |
> |
qq{-e 'Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2' } . |
| 347 |
> |
qq{-e 'Dz=sqrt(1-Dx*Dx-Dy*Dy)' } . |
| 348 |
> |
qq{-e 'xp=(\$3+r3)*(($dim[1]-$dim[0])/$nx)+$dim[0]' } . |
| 349 |
> |
qq{-e 'yp=(\$2+r4)*(($dim[3]-$dim[2])/$ny)+$dim[2]' } . |
| 350 |
|
qq{-e 'zp=$dim[5-$forw]' -e 'myDz=Dz*($forw*2-1)' } . |
| 351 |
|
qq{-e '\$1=xp-Dx;\$2=yp-Dy;\$3=zp-myDz' } . |
| 352 |
|
qq{-e '\$4=Dx;\$5=Dy;\$6=myDz' -of } . |
| 437 |
|
} |
| 438 |
|
} |
| 439 |
|
if ($pctcull >= 0) { |
| 440 |
< |
my $avg = ( $dorecip && "$typ" =~ /^r[fb]/ ) ? " -a" : ""; |
| 440 |
> |
my $avg = ( $dorecip && ( $tensortree == 3 || "$typ" =~ /^r[fb]/ ) ) ? " -a" : ""; |
| 441 |
|
my $pcull = ("$spec" eq "Visible") ? $pctcull : |
| 442 |
|
(100 - (100-$pctcull)*.25) ; |
| 443 |
|
if ($windoz) { |