File: multiclip_ray.pml

package info (click to toggle)
pymol 2.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,312 kB
  • sloc: cpp: 480,106; python: 79,860; ansic: 28,343; javascript: 6,792; sh: 47; makefile: 30; csh: 8
file content (44 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

# example script for creation of an image with a slice region
load /usr/share/pymol/test/dat/1tii.pdb

orient

# must disable depth cue and shadows

unset depth_cue
unset ray_shadows

# this controls the z depth of the slice plane
# (sets it halfway between the clipping planes)

fraction = 0.40
view = cmd.get_view()
near_dist = fraction*(view[16]-view[15])
far_dist = (view[16]-view[15]) - near_dist
cmd.clip("near", -near_dist)

# render opaque background image

as surface
set ray_interior_color, grey80
set opaque_background
set surface_color, white
ray
save image_back.png

cmd.clip("near", near_dist)
cmd.clip("far", far_dist)

# render the foreground image

as cartoon
util.cbc
unset opaque_background
ray
save image_front.png

# now use Photoshop, Gimp, or ImageMagick to combine the images

system composite image_front.png image_back.png image_merged.png
system display image_merged.png