The ihm.geometry Python module

Classes for handling geometry.

Geometric objects (see GeometricObject) are usually used in GeometricRestraint objects.

class ihm.geometry.Center(x, y, z)[source]

Define the center of a geometric object in Cartesian space.

Parameters:
  • x (float) – x coordinate

  • y (float) – y coordinate

  • z (float) – z coordinate

class ihm.geometry.Transformation(rot_matrix, tr_vector)[source]

Rotation and translation applied to an object.

Transformation objects are typically used in subclasses of GeometricObject, or by ihm.dataset.TransformedDataset.

Parameters:
  • rot_matrix – Rotation matrix (as a 3x3 array of floats) that places the object in its final position.

  • tr_vector – Translation vector (as a 3-element float list) that places the object in its final position.

class ihm.geometry.GeometricObject(name=None, description=None)[source]

A generic geometric object. See also Sphere, Torus, Axis, Plane.

Geometric objects are typically assigned to one or more GeometricRestraint objects.

Parameters:
  • name (str) – A short user-provided name.

  • description (str) – A brief description of the object.

class ihm.geometry.Sphere(center, radius, transformation=None, name=None, description=None)[source]

A sphere in Cartesian space.

Parameters:
  • center (Center) – Coordinates of the center of the sphere.

  • radius – Radius of the sphere.

  • transformation (Transformation) – Rotation and translation that moves the sphere from the original center to its final location, if any.

  • name (str) – A short user-provided name.

  • description (str) – A brief description of the object.

class ihm.geometry.Torus(center, major_radius, minor_radius, transformation=None, name=None, description=None)[source]

A torus in Cartesian space.

Parameters:
  • center (Center) – Coordinates of the center of the torus.

  • major_radius – The major radius - the distance from the center of the tube to the center of the torus.

  • minor_radius – The minor radius - the radius of the tube.

  • transformation (Transformation) – Rotation and translation that moves the torus (which by default lies in the xy plane) from the original center to its final location, if any.

  • name (str) – A short user-provided name.

  • description (str) – A brief description of the object.

class ihm.geometry.HalfTorus(center, major_radius, minor_radius, thickness, transformation=None, inner=None, name=None, description=None)[source]

A section of a Torus. This is defined as a surface over part of the torus with a given thickness, and is often used to represent a membrane.

Parameters:
  • thickness – The thickness of the surface.

  • inner – True if the surface is the ‘inner’ half of the torus (i.e. closer to the center), False for the outer surface, or None for some other section (described in description).

See Torus for a description of the other parameters.

class ihm.geometry.Axis(transformation=None, name=None, description=None)[source]

One of the three Cartesian axes - see XAxis, YAxis, ZAxis.

Parameters:
  • transformation (Transformation) – Rotation and translation that moves the axis from the original Cartesian axis to its final location, if any.

  • name (str) – A short user-provided name.

  • description (str) – A brief description of the object.

class ihm.geometry.XAxis(transformation=None, name=None, description=None)[source]

The x Cartesian axis.

See GeometricObject for a description of the parameters.

class ihm.geometry.YAxis(transformation=None, name=None, description=None)[source]

The y Cartesian axis.

See GeometricObject for a description of the parameters.

class ihm.geometry.ZAxis(transformation=None, name=None, description=None)[source]

The z Cartesian axis.

See GeometricObject for a description of the parameters.

class ihm.geometry.Plane(transformation=None, name=None, description=None)[source]

A plane in Cartesian space - see XYPlane, YZPlane, XZPlane.

Parameters:
  • transformation (Transformation) – Rotation and translation that moves the plane from the original position to its final location, if any.

  • name (str) – A short user-provided name.

  • description (str) – A brief description of the object.

class ihm.geometry.XYPlane(transformation=None, name=None, description=None)[source]

The xy plane in Cartesian space.

See GeometricObject for a description of the parameters.

class ihm.geometry.YZPlane(transformation=None, name=None, description=None)[source]

The yz plane in Cartesian space.

See GeometricObject for a description of the parameters.

class ihm.geometry.XZPlane(transformation=None, name=None, description=None)[source]

The xz plane in Cartesian space.

See GeometricObject for a description of the parameters.