Package schrodinger :: Package graphics3d :: Module polyhedron
[hide private]
[frames] | no frames]

Module polyhedron

The polyhedron module allows creation and drawing of polyhedra. The body of the polyhedron is composed of faces that are composed of vertices.

Drawing is done in the current OpenGL rendering context and current OpenGL window, so you must set those prior to drawing. If you are using this with Maestro's drawing callback mechanism the context and window are handled automatically.

Control over the vertices, faces, color, and opacity of a box are provided. However, please note that the current implementation does not ensure the passed in vertices and faces will enclose to form a volume. This must be determined in the subclass.

To draw any number of polyhedra, create the Polyhedron instances, add them to a Group instance then invoke the Group's draw() method.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  Polyhedron
Class to draw a 3D polyhedron with OpenGL using the current context in whatever is the current drawable (which could be Maestro).
  PolyhedronCore
  Cube
Class to draw a 3D cube in Maestro's Workspace.
  Tetrahedron
Class to draw a 3D tetrahedron in Maestro's Workspace.
  Octahedron
Class to draw a 3D octahedron in Maestro's Workspace.
  Dodecahedron
Class to draw a 3D dodecahedron in Maestro's Workspace.
  Icosahedron
Class to draw a 3D icosahedron in Maestro's Workspace.
Functions [hide private]
 
origin_to_point(vertices, center)
Takes a set of vertices that have been created around the origin and translates them to the be centered around the x, y, z coordinates supplied in center.
 
scale_vertices(vertices, scale)
Scale a set of vertices.
Variables [hide private]
  maestro = None
hash(x)
  OPACITY_DEFAULT = 1.0
  COLOR_DEFAULT = 'red'
  PHI = 1.61803398875
  MODE_MAESTRO = 0
  MODE_STANDALONE = 1
  __package__ = 'schrodinger.graphics3d'
Function Details [hide private]

origin_to_point(vertices, center)

 

Takes a set of vertices that have been created around the origin and translates them to the be centered around the x, y, z coordinates supplied in center.

Parameters:
  • vertices (list of lists (e.g. [[x1,y1,z1],[x2,y2,z2],...]) - The list of vertices around the origin
  • center (list of floats) - The x, y, and z coordinates to center the vertices on

scale_vertices(vertices, scale)

 

Scale a set of vertices.

Parameters:
  • vertices (list of lists (e.g. [[x1,y1,z1],[x2,y2,z2],...]) - The list of vertices around the origin
  • scale (float) - The scale to apply to the vertices