ortographic=""
bx0=""; by0=""; bz0="";
bx1=""; by1=""; bz1="";
-bcr="";
+bcr="0.1";
clx="0"; cly="0"; clz="0";
extra=0
displace=""
mx1=0; mx2=0; mx3=0;
my1=0; my2=0; my3=0;
mz1=0; mz2=0; mz3=0;
+ab=0
# parse argv
my1=$5; my2=$6; my3=$7;
mz1=$8; mz2=$9; mz3=${10};
mirror=1; shift 10;;
-
+ -A) ab=1;
+ anr=$2; cutoff=$3; shift 3;;
*)
echo "options:"
echo "########"
echo " -c <x> <y> <z> (camera position)"
echo " -L <x> <y> <z> (camera look)"
echo " -l <x> <y> <z> (light source)"
+ echo "bonds:"
+ echo " -ab <atom number> <cutoff> (auto bonds)"
exit 1;;
esac
done
}' >> temp.pov
fi
- fi
+ fi
+
+ # auto bonds
+ if [ "$ab" = "1" ]; then
+ ((tmp=anr+1))
+ line="`sed -n ${tmp}p $file`"
+ aX=`echo $line | awk '{ print $2 }'`
+ aY=`echo $line | awk '{ print $3 }'`
+ aZ=`echo $line | awk '{ print $4 }'`
+ export aX aY aZ cutoff mirror
+ cat $file | grep -v '#' | awk '\
+ BEGIN {
+ x=ENVIRON["aX"]; y=ENVIRON["aY"]; z=ENVIRON["aZ"];
+ co=ENVIRON["cutoff"]; dist=0; bcr=ENVIRON["bcr"];
+ mx1=ENVIRON["mx1"]; my1=ENVIRON["my1"];
+ mz1=ENVIRON["mz1"]; mx2=ENVIRON["mx2"];
+ my2=ENVIRON["my2"]; mz2=ENVIRON["mz2"];
+ mx3=ENVIRON["mx3"]; my3=ENVIRON["my3"];
+ mz3=ENVIRON["mz3"]; mirror=ENVIRON["mirror"];
+ }
+ {
+ dist=sqrt((x-$2)^2+(y-$3)^2+(z-$4)^2);
+ if((dist<=co)&&(dist>0.01)) {
+ print "cylinder {";
+ print "<"x","z","y">,";
+ print "<"$2","$4","$3">, "bcr;
+ print "pigment { color Blue }";
+ print "}";
+ }
+
+ if(mirror) {
+ nx=$2-mx1; ny=$3-mx2; nz=$4-mx3;
+ dist=sqrt((x-nx)^2+(y-ny)^2+(z-nz)^2)
+ if((dist<=co)&&(dist>0.01)) {
+ print "cylinder {";
+ print "<"x","z","y">,";
+ print "<"nx","nz","ny">, "bcr;
+ print "pigment { color Blue }";
+ print "}";
+ }
+ nx=$2-my1; ny=$3-my2; nz=$4-my3;
+ dist=sqrt((x-nx)^2+(y-ny)^2+(z-nz)^2)
+ if((dist<=co)&&(dist>0.01)) {
+ print "cylinder {";
+ print "<"x","z","y">,";
+ print "<"nx","nz","ny">, "bcr;
+ print "pigment { color Blue }";
+ print "}";
+ }
+ nx=$2-mz1; ny=$3-mz2; nz=$4-mz3;
+ dist=sqrt((x-nx)^2+(y-ny)^2+(z-nz)^2)
+ if((dist<=co)&&(dist>0.01)) {
+ print "cylinder {";
+ print "<"x","z","y">,";
+ print "<"nx","nz","ny">, "bcr;
+ print "pigment { color Blue }";
+ print "}";
+ }
+ }
+
+ }' >> temp.pov
+ fi
# add camera and light source
cat >> temp.pov <<-EOF