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 }
18 directory="doesnt_exist____for_sure"
25 lx="0"; ly="-100"; lz="100";
26 bx0=""; by0=""; bz0="";
27 bx1=""; by1=""; bz1="";
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;;
40 -b) bx0=$2; by0=$3; bz0=$4;
41 bx1=$5; by1=$6; bz1=$7; shift 7;;
45 echo "directory to progress:"
46 echo " -d <directory> (mandatory)"
52 echo "visualization volume:"
53 echo " -nll <x> <y> <z> (near lower left)"
54 echo " -fur <x> <y> <z> (far upper right)"
55 echo " -o (ortographic)"
57 echo " -b <x0> <y0> <z0> <x1> <y1> <z1>"
59 echo " -c <x> <y> <z> (camera position)"
60 echo " -l <x> <y> <z> (light source)"
65 if [ ! -d $directory ] ; then
66 echo "no valid directory"
70 POVRAY="povray -W${width} -H${height} -d"
72 for file in $directory/atomic_conf_*.xyz; do
76 #include "textures.inc"
85 count=`grep '# \[P\]' $file | awk '{ print $3 }'`
86 time=`grep '# \[P\]' $file | awk '{ print $4 }'`
87 camloc=`grep '# \[P\]' $file | awk '{ print $5 }'`
88 [ -n "$cx" -a -n "$cy" -a -n "$cz" ] && camloc="<$cx,$cz,$cy>"
92 export x0 y0 z0 x1 y1 z1 radius
93 cat $file | grep -v '#' | awk '\
95 x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"];
96 x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"];
97 radius=ENVIRON["radius"];
100 if(($2>=x0)&&($3>=y0)&&($4>=z0)&&\
101 ($2<=x1)&&($3<=y1)&&($4<=z1)) {
102 print "sphere { <"$2","$4","$3">, "radius" ";
103 print "texture { pigment { color "$5" } ";
104 print "finish { phong 1 metallic } } }";
108 cat $file | grep -v '#' | while read name x y z color temp; do
109 cat >> temp.pov <<-EOF
111 <$x, $z, $y>, $radius
113 pigment { color $color }
125 if [ -z "$bx0" ]; then
127 if [ -z "$x0" ]; then
128 cat $file | grep '# \[D\]' | while read foo bar x1 y1 z1 x2 y2 z2 ; do
129 cat >> temp.pov <<-EOF
131 <$x1, $z1, $y1>, <$x2, $z2, $y2>, 0.05
132 pigment { color White }
137 # manually drawing the 3x4 boundaries ...
138 draw_cyl $x0 $y0 $z0 $x1 $y0 $z0
139 draw_cyl $x0 $y0 $z0 $x0 $y1 $z0
140 draw_cyl $x1 $y1 $z0 $x1 $y0 $z0
141 draw_cyl $x0 $y1 $z0 $x1 $y1 $z0
143 draw_cyl $x0 $y0 $z1 $x1 $y0 $z1
144 draw_cyl $x0 $y0 $z1 $x0 $y1 $z1
145 draw_cyl $x1 $y1 $z1 $x1 $y0 $z1
146 draw_cyl $x0 $y1 $z1 $x1 $y1 $z1
148 draw_cyl $x0 $y0 $z1 $x0 $y0 $z0
149 draw_cyl $x0 $y1 $z1 $x0 $y1 $z0
150 draw_cyl $x1 $y0 $z1 $x1 $y0 $z0
151 draw_cyl $x1 $y1 $z1 $x1 $y1 $z0
156 # manually drawing the 3x4 boundaries specified by argv ...
157 draw_cyl $bx0 $by0 $bz0 $bx1 $by0 $bz0
158 draw_cyl $bx0 $by0 $bz0 $bx0 $by1 $bz0
159 draw_cyl $bx1 $by1 $bz0 $bx1 $by0 $bz0
160 draw_cyl $bx0 $by1 $bz0 $bx1 $by1 $bz0
162 draw_cyl $bx0 $by0 $bz1 $bx1 $by0 $bz1
163 draw_cyl $bx0 $by0 $bz1 $bx0 $by1 $bz1
164 draw_cyl $bx1 $by1 $bz1 $bx1 $by0 $bz1
165 draw_cyl $bx0 $by1 $bz1 $bx1 $by1 $bz1
167 draw_cyl $bx0 $by0 $bz1 $bx0 $by0 $bz0
168 draw_cyl $bx0 $by1 $bz1 $bx0 $by1 $bz0
169 draw_cyl $bx1 $by0 $bz1 $bx1 $by0 $bz0
170 draw_cyl $bx1 $by1 $bz1 $bx1 $by1 $bz0
174 # add camera and light source
175 cat >> temp.pov <<-EOF
178 if [ -n "$ortographic" ]; then cat >> temp.pov <<-EOF
182 cat >> temp.pov <<-EOF
186 light_source { <0,100,-100> color White shadowless }
190 $POVRAY temp.pov > /dev/null 2>&1
191 mv temp.png `echo $file | sed 's/\.xyz/\.png/'`