Scripts: vclip.py

File vclip.py, 911 bytes (added by goddard, 14 years ago)
Line 
1# Script to show the intersection of two maps as surfaces and the parts
2# outside the intersection in mesh with each map colored separately.
3
4from chimera import runCommand as r
5r('open emdbID:1283 emdbID:1284')
6r('volume #0,1 level 0.35 color lightyellow')
7
8# Show surfaces for the intersection of the two maps.
9# This has to be done in Python. No Chimera command currently available.
10from Surface import clip
11import VolumeViewer as VV
12v1, v2 = VV.volume_list()
13s1, i1 = clip.volume_surface(v1)
14s2, i2 = clip.volume_surface(v2)
15clip.clip_surfaces(s1, i1, s2, i2)
16
17# Open two more copies of the maps to show as mesh
18r('open emdbID:1283 emdbID:1284')
19
20# Set the contour level slightly higher so it is hidden by interesection.
21r('volume #2,3 style mesh level 0.352')
22
23# Color mesh with transparency.
24r('volume #2 color 0,1,0,0.5')
25r('volume #3 color 1,0,0,0.5')
26
27# Set background color
28r('set bg_color dimgray')