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

Module shapes

Classes and functions to handle various shapes.

Copyright Schrodinger, LLC. All rights reserved.

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 = array([ 1., 0., 0.])
  Y_AXIS = array([ 0., 1., 0.])
  Z_AXIS = array([ 0., 0., 1.])
  TEMPLATE_ELEMENT = 'C'
  TEMPLATE_BOND_ORDER = 1
  INF_NAN_THRESH = 1e-12
  DISTANCE_THRESH = 0.0001
  SQRT2 = 1.41421356237
  INVSQRT2 = 0.707106781187
  GOLDEN = 1.61803398875
  INVGOLDEN = 0.61803398875
  PI = 3.14159265359
  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', <class 's...
  __package__ = 'schrodinger.application.matsci'
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', <class 'schrodinger.application.matsci.shapes.Cu\
be'>), ('tetrahedron', <class 'schrodinger.application.matsci.shapes.T\
etrahedron'>), ('octahedron', <class 'schrodinger.application.matsci.s\
hapes.Octahedron'>), ('dodecahedron', <class 'schrodinger.application.\
matsci.shapes.Dodecahedron'>), ('icosahedron', <class 'schrodinger.app\
lication.matsci.shapes.Icosahedron'>), ('cubeoctahedron', <class 'schr\
odinger.application.matsci.shapes.Cubeoctahedron'>), ('slab', <class '\
schrodinger.application.matsci.shapes.Slab'>), ('parallelepiped', <cla\
...