ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/objline.csh
Revision: 2.6
Committed: Sun Nov 30 19:56:02 2008 UTC (14 years, 10 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R0, rad5R2, rad4R2P2, rad4R2P1, rad5R1, rad4R2, rad4R1, rad4R0, rad5R3, HEAD
Changes since 2.5: +9 -7 lines
Log Message:
Made script more robust to different file names

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: objline.csh,v 2.5 2008/08/25 04:50:32 greg Exp $
3 # Create four standard views of scene and present as line drawings
4 #
5 set oblqxf="-rz 45 -ry 45"
6 onintr quit
7 set d=`mktemp -d /tmp/ol.XXXXXX`
8 if ($#argv) then
9 set origf=""
10 set oblqf=""
11 foreach f ($argv)
12 set fn="$f:t"
13 set fn="$fn:r"
14 xform $f:q > $d/$fn:q.orig
15 rad2mgf $d/$fn:q.orig > $d/$fn:q.orig.mgf
16 set origf=($origf:q $fn:q.orig.mgf)
17 echo i $fn:q.orig.mgf $oblqxf > $d/$fn:q.oblq.mgf
18 set oblqf=($oblqf:q $fn:q.oblq.mgf)
19 end
20 else
21 set origf=stdin.orig.mgf
22 set oblqf=stdin.oblq.mgf
23 xform > $d/stdin.orig
24 rad2mgf $d/stdin.orig > $d/stdin.orig.mgf
25 echo i stdin.orig.mgf $oblqxf > $d/stdin.oblq.mgf
26 endif
27 cd $d
28 set rce='xm=($1+$2)/2;ym=($3+$4)/2;zm=($5+$6)/2;\
29 max(a,b):if(a-b,a,b);r=max(max($2-$1,$4-$3),$6-$5)*.52;\
30 $1=xm-r;$2=xm+r;$3=ym-r;$4=ym+r;$5=zm-r;$6=zm+r'
31 set origdim=`getbbox -h *.orig | rcalc -e $rce:q`
32 set oblqdim=`xform $oblqxf *.orig | getbbox -h | rcalc -e $rce:q`
33 mgf2meta -t .005 x $origdim $origf > x.mta
34 mgf2meta -t .005 y $origdim $origf > y.mta
35 mgf2meta -t .005 z $origdim $origf > z.mta
36 mgf2meta -t .005 x $oblqdim $oblqf > o.mta
37 plot4 {x,y,z,o}.mta
38 quit:
39 cd
40 exec rm -rf $d