From d13da35aeda0b12006d4568b271b26c8d9365c5a Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 29 Sep 2009 17:06:24 +0200 Subject: [PATCH] support bonds for more than one atom --- vasp_tools/stdvis | 8 ++++---- vasp_tools/visualize | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/vasp_tools/stdvis b/vasp_tools/stdvis index c108a8d..b5685ec 100755 --- a/vasp_tools/stdvis +++ b/vasp_tools/stdvis @@ -29,7 +29,7 @@ echo "type: 1 no rotation" -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \ -b 0.0 0.0 0.0 1.0 1.0 1.0 \ -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ - -r 0.6 -A 193 1.9 + -r 0.6 -A 1 217 1.9 fi # first unit cell in each direction without rotation displaying mirrored atoms @@ -40,7 +40,7 @@ echo "type: 1 no rotation, mirrored" -b 0.0 0.0 0.0 1.0 1.0 1.0 \ -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \ - -A 193 1.9 + -A 2 217 218 1.9 fi # three unit cells in each direction without rotation @@ -77,11 +77,11 @@ fi if [ "$type" = "1rm" ]; then echo "type: 1 rotated, mirrored" ./visualize -w 640 -h 480 -d $i \ - -nll -0.20 -0.20 -0.20 -fur 1.20 1.20 1.20 \ + -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \ -b 0.0 0.0 0.0 1.0 1.0 1.0 \ -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ -r 0.6 -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0 \ - -A 193 1.9 + -A 1 193 1.9 fi # three unit cells (rotated) in each direction displaying mirrored atoms diff --git a/vasp_tools/visualize b/vasp_tools/visualize index 793e72e..1ed430c 100755 --- a/vasp_tools/visualize +++ b/vasp_tools/visualize @@ -71,8 +71,13 @@ while [ "$1" ]; do 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;; + -A) ab=$2; shift 2; + ((cnt=1)) + while [ $cnt -le $ab ]; do + anr[$cnt]=$1; shift 1; + ((cnt+=1)) + done + cutoff=$1; shift 1;; *) echo "options:" echo "########" @@ -351,7 +356,11 @@ EOF fi # auto bonds - if [ "$ab" = "1" ]; then + if [ "$ab" != "0" ]; then + ((cnt=1)) + while [ $cnt -le $ab ]; do + anr=${anr[$cnt]} + ((tmp=anr+1)) line="`sed -n ${tmp}p $file`" aX=`echo $line | awk '{ print $2 }'` @@ -409,6 +418,9 @@ EOF } }' >> temp.pov + + ((cnt+=1)) + done fi # add camera and light source -- 2.20.1