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
     1 #!/bin/csh -f
     2 # RCSid: $Id: objline.csh,v 2.6 2008/11/30 19:56:02 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