File: hsc_hemilight.py

package info (click to toggle)
openstructure 2.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,240 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (30 lines) | stat: -rw-r--r-- 1,048 bytes parent folder | download | duplicates (4)
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
e=io.LoadPDB("../demos/data/sdh.pdb")
scene.Add(gfx.Entity("x",gfx.HSC,e.Select("chain=A")))
scene["x"].GetOptions(gfx.HSC).SetTubeRadius(0.6)
# spiral helices (default)
scene["x"].GetOptions(gfx.HSC).SetHelixMode(0)
# straight strands
scene["x"].GetOptions(gfx.HSC).SetStrandMode(1)
# colors
scene["x"].SetColor(gfx.Color(0.9,0.95,1.0))
scene["x"].SetColor(gfx.Color(1.0,0.9,0.7),"rtype=helix")
scene["x"].SetDetailColor(gfx.Color(1.0,0.95,0.78),"rtype=helix")
scene["x"].SetColor(gfx.Color(0.5,1.0,0.7),"rtype=strand")
scene["x"].SetDetailColor(gfx.Color(0.7,1.0,0.79),"rtype=strand")

# switch to hemilighting mode
scene.SetShadingMode("hf")
# add outline to improved visibility
scene["x"].Outline(True)
scene["x"].SetOutlineMode(1)
scene["x"].SetOutlineWidth(4.5)

# looks best on white bg
scene.bg=gfx.WHITE

scene.SetRTC(geom.Mat4(-0.589889,-0.594876,0.546034,28.2245,
                        0.806165,-0.472502,0.356147,20.1685,
                        0.0461388,0.65028,0.758291,73.5665,
                        -3.52709,1.72253,-120,1))