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.
|
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 . |
|
|
|
|
|
maestro = None
hash(x)
|
|
OPACITY_DEFAULT = 1.0
|
|
COLOR_DEFAULT = 'red'
|
|
PHI = 1.0+ sqrt(5.0)/ 2.0
|
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
|