5 # author: frank.zirkelbach@physik.uni-augsburg.de
10 cat >> temp.pov <<-EOF
12 <$1, $3, $2>, <$4, $6, $5>, 0.05
13 pigment { color White }
20 directory="doesnt_exist____for_sure"
27 lx="0"; ly="-100"; lz="100";
31 -d) directory=$2; shift 2;;
32 -w) width=$2; shift 2;;
33 -h) height=$2; shift 2;;
34 -r) radius=$2; shift 2;;
35 -nll) x0=$2; y0=$3; z0=$4; shift 4;;
36 -fur) x1=$2; y1=$3; z1=$4; shift 4;;
37 -c) cx=$2; cy=$3; cz=$4; shift 4;;
38 -l) lx=$2; ly=$3; lz=$4; shift 4;;
39 -o) ortographic=1; shift 1;;
43 echo "directory to progress:"
44 echo " -d <directory> (mandatory)"
50 echo "visualization volume:"
51 echo " -nll <x> <y> <z> (near lower left)"
52 echo " -fur <x> <y> <z> (far upper right)"
53 echo " -o (ortographic)"
55 echo " -c <x> <y> <z> (camera position)"
56 echo " -l <x> <y> <z> (light source)"
61 if [ ! -d $directory ] ; then
62 echo "no valid directory"
66 POVRAY="povray -W${width} -H${height} -d"
68 for file in $directory/atomic_conf_*.xyz; do
72 #include "textures.inc"
81 count=`grep '# \[P\]' $file | awk '{ print $3 }'`
82 time=`grep '# \[P\]' $file | awk '{ print $4 }'`
83 camloc=`grep '# \[P\]' $file | awk '{ print $5 }'`
84 [ -n "$cx" -a -n "$cy" -a -n "$cz" ] && camloc="<$cx,$cz,$cy>"
88 export x0 y0 z0 x1 y1 z1 radius
89 cat $file | grep -v '#' | awk '\
91 x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"];
92 x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"];
93 radius=ENVIRON["radius"];
96 if(($2>=x0)&&($3>=y0)&&($4>=z0)&&\
97 ($2<=x1)&&($3<=y1)&&($4<=z1)) {
98 print "sphere { <"$2","$4","$3">, "radius" ";
99 print "texture { pigment { color "$5" } ";
100 print "finish { phong 1 metallic } } }";
104 cat $file | grep -v '#' | while read name x y z color temp; do
105 cat >> temp.pov <<-EOF
107 <$x, $z, $y>, $radius
109 pigment { color $color }
121 if [ -z "$x0" ]; then
122 cat $file | grep '# \[D\]' | while read foo bar x1 y1 z1 x2 y2 z2 ; do
123 cat >> temp.pov <<-EOF
125 <$x1, $z1, $y1>, <$x2, $z2, $y2>, 0.05
126 pigment { color White }
131 # manually drawing the 3x4 boundaries ...
132 draw_cyl $x0 $y0 $z0 $x1 $y0 $z0
133 draw_cyl $x0 $y0 $z0 $x0 $y1 $z0
134 draw_cyl $x1 $y1 $z0 $x1 $y0 $z0
135 draw_cyl $x0 $y1 $z0 $x1 $y1 $z0
137 draw_cyl $x0 $y0 $z1 $x1 $y0 $z1
138 draw_cyl $x0 $y0 $z1 $x0 $y1 $z1
139 draw_cyl $x1 $y1 $z1 $x1 $y0 $z1
140 draw_cyl $x0 $y1 $z1 $x1 $y1 $z1
142 draw_cyl $x0 $y0 $z1 $x0 $y0 $z0
143 draw_cyl $x0 $y1 $z1 $x0 $y1 $z0
144 draw_cyl $x1 $y0 $z1 $x1 $y0 $z0
145 draw_cyl $x1 $y1 $z1 $x1 $y1 $z0
148 # add camera and light source
149 cat >> temp.pov <<-EOF
152 if [ -n "$ortographic" ]; then cat >> temp.pov <<-EOF
156 cat >> temp.pov <<-EOF
160 light_source { <0,100,-100> color White shadowless }
164 $POVRAY temp.pov > /dev/null 2>&1
165 mv temp.png `echo $file | sed 's/\.xyz/\.png/'`