计算化学公社

标题: vmd中绘制辅助线来显示分子与表面的位置关系 [打印本页]

作者
Author:
liucw    时间: 2022-10-19 10:04
标题: vmd中绘制辅助线来显示分子与表面的位置关系
本帖最后由 liucw 于 2022-10-19 10:08 编辑

###绘制桥位苯环中心与桥位中心的连线#draw color red
draw color yellow
set bb [atomselect top "type C1 or type C2 or type C3 or type C4 or type C5 or type C6"]
set ben [measure center $bb]
set xw [lindex $ben 0]
set yw [lindex $ben 1]
set zw [lindex $ben 2]
set n1 122
set n2 131
set aa [atomselect top "index $n1 or index $n2"]
set com [measure center $aa]
set xq [lindex $com 0]
set yq [lindex $com 1]
set zq [lindex $com 2]
#draw sphere "$xq $yq $zq" radius 0.5
draw line "$xw $yw $zw" "$xq $yq $zq" width 1 style dashed

###绘制桥位苯环中心与洞位中心的连线
  1. draw color red
  2. #draw color yellow
  3. set bb [atomselect top "type C1 or type C2 or type C3 or type C4 or type C5 or type C6"]
  4. set ben [measure center $bb]
  5. set xw [lindex $ben  0]
  6. set yw [lindex $ben  1]
  7. set zw [lindex $ben  2]

  8. set bb [atomselect top "index 128 or index 131 or index 122"]
  9. set com [measure center $bb]
  10. set xq [lindex $com  0]
  11. set yq [lindex $com  1]
  12. set zq [lindex $com  2]
  13. #set xq [lindex [$bb get {x y z}] 0]
  14. #set yq [lindex [$bb get {x y z}] 1]
  15. #set zq [lindex [$bb get {x y z}] 2]
  16. #draw sphere "$xq $yq $zq" radius 0.2
  17. draw line "$xw $yw $zw" "$xq $yq $zq" width 1
复制代码
效果如下图所示:






欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3