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) { |