gfx_symmetry.py

Uses the gfx::SymmetryNode class to draw the symmetry equivalents of a small protein fragment.

By using rigid body manipulator, the relative orientation of the fragments can be adjusted.

import math
from ost import geom

filename='fragment.pdb'
if len(sys.argv)>1:
  filename=sys.argv[1]
ent=io.LoadEntity(filename)

edi=ent.EditXCS()
m=geom.Mat4()
m.PasteTranslation(-ent.bounds.min)
edi.ApplyTransform(m)
edi.UpdateICS()
frag=gfx.Entity('frag', ent)
sym_ops=gfx.SymmetryOpList()
for i in range(12):
  m=geom.EulerTransformation(0, i*2.0*math.pi/12.0, 0)
  sym_ops.append(gfx.SymmetryOp(m, geom.Vec3(0, 0, 10)))
  
sym=gfx.SymmetryNode('sym', sym_ops)
scene.Add(sym)
sym.Add(frag)

scene.SetCenter(geom.Vec3())
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 1 Mar 2018 for OpenStructure by  doxygen 1.6.1