5 # author: frank.zirkelbach@physik.uni-augsburg.de
8 directory="doesnt_exist____for_sure"
15 lx="0"; ly="-100"; lz="100";
19 -d) directory=$2; shift 2;;
20 -w) width=$2; shift 2;;
21 -h) height=$2; shift 2;;
22 -r) radius=$2; shift 2;;
23 -nll) x0=$2; y0=$3; z0=$4; shift 4;;
24 -fur) x1=$2; y1=$3; z1=$4; shift 4;;
25 -c) cx=$2; cy=$3; cz=$4; shift 4;;
26 -l) lx=$2; ly=$3; lz=$4; shift 4;;
27 -o) ortographic=1; shift 1;;
31 echo "directory to progress:"
32 echo " -d <directory> (mandatory)"
38 echo "visualization volume:"
39 echo " -nll <x> <y> <z> (near lower left)"
40 echo " -fur <x> <y> <z> (far upper right)"
41 echo " -o (ortographic)"
43 echo " -c <x> <y> <z> (camera position)"
44 echo " -l <x> <y> <z> (light source)"
49 if [ ! -d $directory ] ; then
50 echo "no valid directory"
54 POVRAY="povray -W${width} -H${height} -d"
56 for file in $directory/atomic_conf_*.xyz; do
60 #include "textures.inc"
69 count=`grep '# \[P\]' $file | awk '{ print $3 }'`
70 time=`grep '# \[P\]' $file | awk '{ print $4 }'`
71 camloc=`grep '# \[P\]' $file | awk '{ print $5 }'`
72 [ -n "$cx" -a -n "$cy" -a -n "$cz" ] && camloc="<$cx,$cz,$cy>"
76 export x0 y0 z0 x1 y1 z1 radius
77 cat $file | grep -v '#' | awk '\
79 x0=ENVIRON["x0"]; y0==ENVIRON["y0"]; z0==ENVIRON["z0"];
80 x1=ENVIRON["x1"]; y0==ENVIRON["y1"]; z0==ENVIRON["z1"];
81 radius=ENVIRON["radius"];
84 if(($2>=x0)&&($3>=y0)&&($4>=z0)&&\
85 ($2<=x1)&&($3<=y1)&&($4<=z1)) {
86 print "sphere { <"$2","$4","$3">, "radius" ";
87 print "texture { pigment { color "$5" } ";
88 print "finish { phong 1, metallic } } }";
92 cat $file | grep -v '#' | while read name x y z color temp; do
93 cat >> temp.pov <<-EOF
97 pigment { color $color }
109 if [ -z "$x0" ]; then
110 cat $file | grep '# \[D\]' | while read foo bar x1 y1 z1 x2 y2 z2 ; do
111 cat >> temp.pov <<-EOF
113 <$x1, $z1, $y1>, <$x2, $z2, $y2>, 0.05
114 pigment { color White }
120 # add camera and light source
121 cat >> temp.pov <<-EOF
124 if [ -n "$ortographic" ]; then cat >> temp.pov <<-EOF
128 cat >> temp.pov <<-EOF
132 light_source { <0,100,-100> color White shadowless }
136 $POVRAY temp.pov > /dev/null 2>&1
137 mv temp.png `echo $file | sed 's/\.xyz/\.png/'`