schrodinger.graphics3d.torus module¶
OpenGL toruses.
The torus module allows creation and drawing of toruses. Clients draw using Group instances not through Torus instances.
Drawing is done in whatever is the current GL rendering context and current GL window. So you must set those prior to drawing. If you are using this with Maestro’s drawing callback mechanism you need not worry about the above details. These are handled for you automatically.
Control over the center, radius, color, resolution and opacity of a torus are provided. See the Torus class for more info.
To draw any number of toruses, create the Torus instance and add it to a Group instance. Then invoke the Group’s draw() method.
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.graphics3d.torus.
vector_normalize
(X)¶
-
schrodinger.graphics3d.torus.
vector_cross
(X, Y)¶ Returns the cross product of the len 3 vectors X and Y
-
class
schrodinger.graphics3d.torus.
TorusCore
(x0=None, y0=None, z0=None, x1=None, y1=None, z1=None, color=None, r=None, g=None, b=None, radius=None, tube_radius=None, transparency=None, opacity=1.0, resolution_u=5, resolution_v=3)¶ Bases:
schrodinger.graphics3d.common.Primitive
Base class for MaestroTorus.
See doc string for __init__ for details on instantiation.
Toruses should be added to a TorusGroup and drawing done via TorusGroup. See TorusGroup documentation.
-
class
schrodinger.graphics3d.torus.
MaestroTorus
(x0=None, y0=None, z0=None, x1=None, y1=None, z1=None, color=None, r=None, g=None, b=None, radius=None, tube_radius=None, transparency=None, opacity=1.0, resolution_u=5, resolution_v=3)¶ Bases:
schrodinger.graphics3d.torus.TorusCore
Class to create a 3D torus in Maestro. This torus will be drawn at the appropriate time in Maestro to interact properly with transparent objects.
Toruses should be added to a Group and drawing done via the Group. See Group documentation.
API Example:
import schrodinger.maestro.maestro as maestro import schrodinger.graphics3d.common as common import schrodinger.graphics3d.torus as torus torus_grp = common.Group() st = maestro.workspace_get() for bond in st.bond: trs = torus.MaestroTorus( x0=bond.atom1.x, y0=bond.atom1.y, z0=bond.atom1.z, x1=bond.atom2.x, y1=bond.atom2.y, z1=bond.atom2.z, radius=0.1, tube_radius=0.5, resolution_u=7, resolution_v=5, opacity=0.8, color='red' ) # Add the primative to the container. torus_grp.add(trs) # MaestroTorus needs to be drawn. # No special callback like there is for Toruses is needed. torus_grp.show() # Hide the markers. torus_grp.hide() # Remove the markers and the callback. torus_grp.clear() maestro.workspace_draw_function_remove(torus_grp.draw)
-
setCoords
()¶
-
setColors
()¶
-
x0
¶ X0 coordinate
-
y0
¶ Y0 coordinate
-
z0
¶ Z0 coordinate
-
x1
¶ X1 coordinate
-
y1
¶ Y1 coordinate
-
z1
¶ Z1 coordinate
-
r
¶ Red value in RGB triplet
-
g
¶ Green value in RGB triplet
-
b
¶ Blue value in RGB triplet
-
radius
¶ Torus’s radius
-
tube_radius
¶ Torus’s tube_radius
-
opacity
¶ Torus’s opacity
-
material
¶ Torus’s material
-
pick_id
¶ Torus object’s pick ID
-
pick_category
¶ Torus’s picking category
-