计算化学公社

 找回密码 Forget password
 注册 Register
Views: 1443|回复 Reply: 0
打印 Print 上一主题 Last thread 下一主题 Next thread

[VMD] vmd中绘制辅助线来显示分子与表面的位置关系

[复制链接 Copy URL]

9

帖子

0

威望

323

eV
积分
332

Level 3 能力者

本帖最后由 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
复制代码
效果如下图所示:

微信图片_20221019095008 (2).png (184.55 KB, 下载次数 Times of downloads: 7)

微信图片_20221019095008 (2).png

微信图片_20221019095017 (2).jpg (266.23 KB, 下载次数 Times of downloads: 1)

微信图片_20221019095017 (2).jpg

评分 Rate

参与人数
Participants 3
eV +12 收起 理由
Reason
卡开发发 + 2 欢迎讨论
丁越 + 5 赞!
乐平 + 5 赞!

查看全部评分 View all ratings

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-2-24 21:59 , Processed in 0.245605 second(s), 24 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list