if [ "$checktsd" = "Transformed" ]; then
((offset=9))
echo "tsd: yes, offset = $offset"
+ # but maybe not
+ checkmore=`sed -n 8p $file | awk '{ print $1 }'`
+ if [ "$checkmore" = "Direct" ]; then
+ ((offset=8))
+ echo "tsd: yes, but anyways using offset $offset"
+ fi
else
((offset=8))
echo "tsd: no, offset = $offset"
fi
while [ "1" ]; do
- echo -en "$count "
+ [ $count -gt $ntot ] && break
if [ $count -le $nsi ]; then
color="Yellow"
y=`echo $line | awk '{ print $2 }'`
z=`echo $line | awk '{ print $3 }'`
- echo $x $y $z | awk '\
+ echo $x $y $z $count | awk '\
BEGIN {
x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"];
x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"];
if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\
(xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
+ print "// atom " $4;
print "sphere { <"xt","zt","yt">, "radius" ";
print "texture { pigment { color " color " } ";
print "finish { phong 1 metallic } } }";
# see, whether there are bonds to draw
if [ "$ab" = "0" ]; then
+ echo -en "$count "
((count+=1))
continue
fi
((cnt+=1))
done
if [ "$ab" = "-1" ]; then
- dobond=yes
+ if [ -n "`grep \/\/\ atom\ $count temp.pov`" ]; then
+ dobond=yes
+ fi
fi
if [ "$dobond" = "no" ]; then
+ echo -en "$count "
((count+=1))
continue;
fi
yt*=scale;
zt*=scale;
+ if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\
+ (xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
+
inx=$4+ii; iny=$5+ij; inz=$6+ik;
ixt=inx*X1+iny*Y1+inz*Z1;
iyt=inx*X2+iny*Y2+inz*Z2;
dist=sqrt((xt-ixt)^2+(yt-iyt)^2+(zt-izt)^2);
- if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\
- (xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
+ #if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\
+ # (xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
if(dist<=$7) {
print "cylinder {";
print "<"xt","zt","yt">,";
print "pigment { color Blue }";
print "}";
}
+ #}
+
}
}
done
+ echo -en "[$count] "
((count+=1))
[ $count -gt $ntot ] && break;
echo
# manually drawing the 3x4 boundaries specified by argv ...
+ if [ -n "$bx0" ]; then
draw_cyl $bx0 $by0 $bz0 $bx1 $by0 $bz0
draw_cyl $bx0 $by0 $bz0 $bx0 $by1 $bz0
draw_cyl $bx1 $by1 $bz0 $bx1 $by0 $bz0
draw_cyl $bx0 $by1 $bz1 $bx0 $by1 $bz0
draw_cyl $bx1 $by0 $bz1 $bx1 $by0 $bz0
draw_cyl $bx1 $by1 $bz1 $bx1 $by1 $bz0
+ fi
# add camera and light source
cat >> temp.pov <<-EOF