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