Package schrodinger :: Package application :: Package matsci :: Module shapes
[hide private]
[frames] | no frames]

Module shapes

Classes [hide private]
  Vertex
Class to manage vertices.
  Edge
Class to manage edges.
  Face
Class to manage faces.
  ConvexPolyhedron
Class to manage a convex polyhedron.
  Cube
Class to manage a cube.
  Tetrahedron
Class to manage a tetrahedron.
  Octahedron
Class to manage an octahedron.
  Dodecahedron
Class to manage a dodecahedron.
  Icosahedron
Class to manage an icosahedron.
  Cubeoctahedron
Class to manage a cubeoctahedron.
  Parallelepiped
Class to manage a parallelepiped.
  Slab
Class to manage a slab.
  Sphere
Class to manage a sphere.
  Cylinder
Class to manage a cylinder.
Functions [hide private]
object
get_shape_object_by_name(name)
Return a shape object by name.
float
get_polygon_area(vertices)
Return the area of the specified polygon using the shoelace formula.
list
get_reference_data(data, attr, num_unique, threshold)
Return a list containing the num_unique number of unique data.
list of numpy.array
get_parallelepiped_vertices(origin, a_vec, b_vec, c_vec, center=True)
Get the vertices of the specified parallelepiped.
numpy.array
get_centroid(vertices)
Return the centroid of the provided vertices.
Variables [hide private]
  __doc__ = ...
  _version = '$Revision 0.0 $'
  ORIGIN = [0.0, 0.0, 0.0]
  X_AXIS = numpy.array(transform.X_AXIS)
  Y_AXIS = numpy.array(transform.Y_AXIS)
  Z_AXIS = numpy.array(transform.Z_AXIS)
  TEMPLATE_ELEMENT = 'C'
  TEMPLATE_BOND_ORDER = 1
  INF_NAN_THRESH = 1.0e-12
  DISTANCE_THRESH = 0.0001
  SQRT2 = math.sqrt(2.0)
  INVSQRT2 = 1.0/ SQRT2
  GOLDEN = constants.golden
  INVGOLDEN = 1.0/ GOLDEN
  PI = constants.pi
  PLATONIC = 'platonic'
  ARCHIMEDEAN = 'archimedean'
  PRISM = 'prism'
  BASIC = 'basic'
  POLYHEDRON_TYPES = [PLATONIC, ARCHIMEDEAN, PRISM]
  LENGTH = 'length'
  AREA = 'area'
  COLINEAR_THRESH = 0.25
  SHAPES_NAMES_TO_OBJECTS_DICT = OrderedDict([(Cube.NAME, Cube),...
Function Details [hide private]

get_shape_object_by_name(name)

 

Return a shape object by name.

Parameters:
  • name (str) - the name of the object wanted
Returns: object
the shape object

get_polygon_area(vertices)

 

Return the area of the specified polygon using the shoelace formula.

Parameters:
  • vertices (list) - contains all vertices of the polygon, each of which is a two dimensional numpy.array, i.e. x and y
Returns: float
the area of the polygon

get_reference_data(data, attr, num_unique, threshold)

 

Return a list containing the num_unique number of unique data. The data will be either a list of Face or a list of Edge characterized using the attr AREA or LENGTH, respectively. These will be the reference data used to orient the polyhedron.

Parameters:
  • data (list) - either all Face objects for a given polyhedron or all Edge objects for a given face
  • attr (str) - the attribute on which to characterize the data, either AREA or LENGTH
  • num_unique (int) - the number of symmetry unique data
  • threshold (float) - the threshold used to consider if two data are equivalent by attr (either Ang. or Ang.^2)
Returns: list
unique data to serve as references

get_parallelepiped_vertices(origin, a_vec, b_vec, c_vec, center=True)

 

Get the vertices of the specified parallelepiped.

Parameters:
  • origin (numpy.array) - the point of origin of the lattic vectors
  • a_vec (numpy.array) - the a lattice vector
  • b_vec (numpy.array) - the b lattice vector
  • c_vec (numpy.array) - the c lattice vector
  • center (bool) - specifies whether or not to translate the final vertices so that the centroid is at (0, 0, 0)
Returns: list of numpy.array
the vertices of the parallelepiped

get_centroid(vertices)

 

Return the centroid of the provided vertices.

Parameters:
  • vertices (list) - numpy.array array of points
Returns: numpy.array
the centroid

Variables Details [hide private]

__doc__

Value:
"""
Classes and functions to handle various shapes.

Copyright Schrodinger, LLC.  All rights reserved."""

SHAPES_NAMES_TO_OBJECTS_DICT

Value:
OrderedDict([(Cube.NAME, Cube), (Tetrahedron.NAME, Tetrahedron), (Octa\
hedron.NAME, Octahedron), (Dodecahedron.NAME, Dodecahedron), (Icosahed\
ron.NAME, Icosahedron), (Cubeoctahedron.NAME, Cubeoctahedron), (Slab.N\
AME, Slab), (Parallelepiped.NAME, Parallelepiped), (Sphere.NAME, Spher\
e), (Cylinder.NAME, Cylinder)])