set all [atomselect top all]
measure minmax $all
set cellxmin [lindex [lindex [measure minmax $all] 0] 0]
set cellxmax [lindex [lindex [measure minmax $all] 1] 0]
set cellymin [lindex [lindex [measure minmax $all] 0] 1]
set cellymax [lindex [lindex [measure minmax $all] 1] 1]
set cellzmin [lindex [lindex [measure minmax $all] 0] 2]
set cellzmax [lindex [lindex [measure minmax $all] 1] 2]
puts "cellOrigin [format "%7.3f %7.3f %7.3f" [lindex [measure center $all] 0] [lindex [measure center $all] 1] [lindex [measure center $all] 2]]"
puts "cellBasisVector1 [format "%7.3f %7.3f %7.3f" [vecsub $cellxmax $cellxmin] 0 0]"
puts "cellBasisVector2 [format "%7.3f %7.3f %7.3f" 0 [vecsub $cellymax $cellymin] 0]"
puts "cellBasisVector3 [format "%7.3f %7.3f %7.3f" 0 0 [vecsub $cellzmax $cellzmin] ]"
Pretty primitive, but it works.
measure minmax $all
set cellxmin [lindex [lindex [measure minmax $all] 0] 0]
set cellxmax [lindex [lindex [measure minmax $all] 1] 0]
set cellymin [lindex [lindex [measure minmax $all] 0] 1]
set cellymax [lindex [lindex [measure minmax $all] 1] 1]
set cellzmin [lindex [lindex [measure minmax $all] 0] 2]
set cellzmax [lindex [lindex [measure minmax $all] 1] 2]
puts "cellOrigin [format "%7.3f %7.3f %7.3f" [lindex [measure center $all] 0] [lindex [measure center $all] 1] [lindex [measure center $all] 2]]"
puts "cellBasisVector1 [format "%7.3f %7.3f %7.3f" [vecsub $cellxmax $cellxmin] 0 0]"
puts "cellBasisVector2 [format "%7.3f %7.3f %7.3f" 0 [vecsub $cellymax $cellymin] 0]"
puts "cellBasisVector3 [format "%7.3f %7.3f %7.3f" 0 0 [vecsub $cellzmax $cellzmin] ]"
Pretty primitive, but it works.
No comments:
Post a Comment