orig/pdfblur.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
axel@0
     1
#!/bin/csh -f
axel@0
     2
# RCSid: $Id: pdfblur.csh,v 2.6 2005/01/18 01:37:43 greg Exp $
axel@0
     3
#
axel@0
     4
# Generate views for depth-of-field blurring on picture
axel@0
     5
#
axel@0
     6
if ($#argv != 3) then
axel@0
     7
	echo "Usage: $0 aperture nsamp viewfile"
axel@0
     8
	exit 1
axel@0
     9
endif
axel@0
    10
set a = "$1"
axel@0
    11
set n = "$2"
axel@0
    12
set vf = "$3"
axel@0
    13
cnt $n | rcalc -e `vwright i < $vf` \
axel@0
    14
-e "M:$n/5+1;a:$a/2;N:$n;" -e 'tmax:PI*a*(M+1)' \
axel@0
    15
-e 't=tmax/N*($1+rand($1))' \
axel@0
    16
-e 'theta=2*M*PI/(M-1)*(M-sqrt(M*M-(M-1)/(PI*a)*t))' \
axel@0
    17
-e 'r=a*(1-(M-1)/(2*M*M*PI)*theta)' \
axel@0
    18
-e 'rcost=r*cos(theta);rsint=r*sin(theta)' \
axel@0
    19
-e 'opx=ipx+rcost*ihx+rsint*ivx' \
axel@0
    20
-e 'opy=ipy+rcost*ihy+rsint*ivy' \
axel@0
    21
-e 'opz=ipz+rcost*ihz+rsint*ivz' \
axel@0
    22
-e 'os=is-rcost/(id*ihn);ol=il-rsint/(id*ivn)' \
axel@0
    23
-o 'VIEW= -vp ${opx} ${opy} ${opz} -vs ${os} -vl ${ol}'