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