IMP logo
core examples: fragments

custom hierarchy

This example shows how to create and use a custom hierarchy of particles.

tr= IMP.core.HierarchyTraits("my hierarchy")
pd= IMP.core.Hierarchy.setup_particle(parent_particle, tr)
for p in children_particles:
pd.add_child(cd)
pd.show()

randomize rigid body

This fragments shows how to either perturb or set the orientation of a rigid body randomly.

# Assume p is a RigidBody Particle
10.0)
# we don't yet have python code to generate a nearby rotation
transformation= IMP.algebra.Transformation3D(rotation, translation)
# note, this overwrites the existing position
# The True is to transform the members now rather than wait for a
# score state
rbd.set_transformation(transformation)
# to instead perturb the existing transformation instead do
rbd.set_transformation(IMP.algebra.compose(rbd.get_transformation(),
transformation))


Generated on Tue May 22 2012 23:33:21 for IMP by doxygen 1.8.1