This module defines several elementary geometrical objects, which can be useful in the construction and analysis of molecular systems. There are essentially two kinds of geometrical objects: shape objects (spheres, planes, etc.), from which intersections can be calculated, and lattice objects, which define a regular arrangements of points.
This is an Glossary:abstract-base-class. To create 3D objects, use one of its subclasses.
Methods:Return a 3D object that represents the intersection with other (another 3D object).
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Box(corner1, corner2)
diagonally opposite corner points
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Sphere(center, radius)
the center of the sphere (a vector)
the radius of the sphere (a number)
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Cylinder(center1, center2, radius)
the center of the bottom circle (a vector)
the center of the top circle (a vector)
the radius (a number)
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Plane(point, normal) or Plane(point1, point2, point3)
any point in the plane
the normal vector of the plane
three points in the plane that are not collinear.
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Cone(center, axis, angle)
the center (tip) of the cone (a vector)
the direction of the axis of rotational symmetry (a vector)
the angle between any straight line on the cone surface and the axis of symmetry (a number)
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Circle(center, normal, radius)
the center of the circle (a vector)
the normal vector of the plane of the sphere (vector)
the radius of the circle (a number)
A subclass of MMTK.Geometry.GeometricalObject3D.
Constructor: Line(point, direction)
any point on the line (a vector)
the direction of the line (a vector)
Returns the smallest distance of point from the line.
Returns the orthogonal projection of point onto the line.
Lattices are special sequence objects that contain vectors (points on the lattice) or objects that are constructed as functions of these vectors. Lattice objects behave like lists, i.e. they permit indexing, length inquiry, and iteration by 'for'-loops. See also the example Miscellaneous/lattice.py.
This is an Glossary:abstract-base-class. To create lattice objects, use one of its subclasses.
A subclass of MMTK.Geometry.Lattice.
Constructor: RhombicLattice(elementary_cell, lattice_vectors, cells, function=None)
a list of points (vectors) in the elementary cell
a list of lattice vectors. Each lattice vector defines a lattice dimension (only values from one to three make sense) and indicates the displacement along this dimension from one cell to the next.
a list of integers, whose length must equal the number of dimensions. Each entry specifies how often a cell is repeated along this dimension.
a function that is called for every lattice point with the vector describing the point as argument. The return value of this function is stored in the lattice object. If the function is None, the vector is directly stored in the lattice object.
The number of objects in the lattice is equal to the product of the values in cells times the number of points in elementary_cell.
A subclass of MMTK.Geometry.Lattice.
A Bravais lattice is a special case of a general rhombic lattice in which the elementary cell contains only one point.
Constructor: BravaisLattice(lattice_vectors, cells, function=None)
a list of lattice vectors. Each lattice vector defines a lattice dimension (only values from one to three make sense) and indicates the displacement along this dimension from one cell to the next.
a list of integers, whose length must equal the number of dimensions. Each entry specifies how often a cell is repeated along this dimension.
a function that is called for every lattice point with the vector describing the point as argument. The return value of this function is stored in the lattice object. If the function is None, the vector is directly stored in the lattice object.
The number of objects in the lattice is equal to the product of the values in cells.
A subclass of MMTK.Geometry.Lattice.
A Simple Cubic lattice is a special case of a Bravais lattice in which the elementary cell is a cube.
Constructor: SCLattice(cell_size, cells, function=None)
the edge length of the elementary cell
a list of integers, whose length must equal the number of dimensions. Each entry specifies how often a cell is repeated along this dimension.
a function that is called for every lattice point with the vector describing the point as argument. The return value of this function is stored in the lattice object. If the function is None, the vector is directly stored in the lattice object.
The number of objects in the lattice is equal to the product of the values in cells.
A subclass of MMTK.Geometry.Lattice.
A Body-Centered Cubic lattice has two points per elementary cell.
Constructor: BCCLattice(cell_size, cells, function=None)
the edge length of the elementary cell
a list of integers, whose length must equal the number of dimensions. Each entry specifies how often a cell is repeated along this dimension.
a function that is called for every lattice point with the vector describing the point as argument. The return value of this function is stored in the lattice object. If the function is None, the vector is directly stored in the lattice object.
The number of objects in the lattice is equal to the product of the values in cells.
A subclass of MMTK.Geometry.Lattice.
A Face-Centered Cubic lattice has four points per elementary cell.
Constructor: FCCLattice(cell_size, cells, function=None)
the edge length of the elementary cell
a list of integers, whose length must equal the number of dimensions. Each entry specifies how often a cell is repeated along this dimension.
a function that is called for every lattice point with the vector describing the point as argument. The return value of this function is stored in the lattice object. If the function is None, the vector is directly stored in the lattice object.
The number of objects in the lattice is equal to the product of the values in cells.