1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
|
<a name="Module:Scientific.Visualization.VPython"><h1>Module Scientific.Visualization.VPython</h1></a>
<hr width=70%>
<h2>Functions</h2>
<ul>
<li> <p>
<a name="Function:Scientific.Visualization.VPython.DiffuseMaterial"><b><i>DiffuseMaterial</i></b>(<i>color</i>)</a><br>
</p>
<p>Returns a material with the <tt>diffuse color</tt> attribute set to <i>color</i>.</p><li> <p>
<a name="Function:Scientific.Visualization.VPython.EmissiveMaterial"><b><i>EmissiveMaterial</i></b>(<i>color</i>)</a><br>
</p>
<p>Returns a material with the <tt>emissive color</tt> attribute set to <i>color</i>.</p></ul>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Scene"><h2>Class Scene: VPython scene</h2></a>
<p>A VPython scene is a collection of graphics objects that can be
shown in a VPython window. When the "view" method is called,
a new window is created and the graphics objects are displayed
in it.</p>
<p>Constructor: Scene(<i>objects</i>=None, **|options|)</p>
<p><dl>
<dt><i>objects</i></dt>
<dd><p>
a list of graphics objects or <tt>None</tt> for an empty scene</p></dd>
<dt><i>options</i></dt>
<dd><p>
options as keyword arguments: "title" (the window title,
default: "VPython scene"), "width" (the window width,
default: 300), "height" (the window height, default: 300),
"background" (the background color, default: <tt>black</tt>)
</p></dd>
</dl>
</p>
<b>Methods:</b><br>
<ul>
<li> <b><i>addObject</i></b>(<i>object</i>)
<p>Adds <i>object</i> to the list of graphics objects.</p>
<li> <b><i>view</i></b>()
<p>Open a VPython window for the scene.</p>
</ul>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Sphere"><h2>Class Sphere: Sphere</h2></a>
<p>Constructor: Sphere(<i>center</i>, <i>radius</i>, **|attributes|)</p>
<p><dl>
<dt><i>center</i></dt>
<dd><p>
the center of the sphere (a vector)</p></dd>
<dt><i>radius</i></dt>
<dd><p>
the sphere radius (a positive number)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Cube"><h2>Class Cube: Cube</h2></a>
<p>Constructor: Cube(<i>center</i>, <i>edge</i>, **|attributes|)</p>
<p><dl>
<dt><i>center</i></dt>
<dd><p>
the center of the cube (a vector)</p></dd>
<dt><i>edge</i></dt>
<dd><p>
the length of an edge (a positive number)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute</p></dd>
</dl>
</p>
<p>The edges of a cube are always parallel to the coordinate axes.
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Cylinder"><h2>Class Cylinder: Cylinder</h2></a>
<p>Constructor: Cylinder(<i>point1</i>, <i>point2</i>, <i>radius</i>, **|attributes|)</p>
<p><dl>
<dt><i>point1</i>, <i>point2</i></dt>
<dd><p>
the end points of the cylinder axis (vectors)</p></dd>
<dt><i>radius</i></dt>
<dd><p>
the radius (a positive number)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Arrow"><h2>Class Arrow: Arrow</h2></a>
<p>Constructor: Arrow(<i>point1</i>, <i>point2</i>, <i>radius</i>, **|attributes|)</p>
<p><dl>
<dt><i>point1</i>, <i>point2</i></dt>
<dd><p>
the end points of the cylinder axis (vectors)</p></dd>
<dt><i>radius</i></dt>
<dd><p>
the radius (a positive number)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Cone"><h2>Class Cone: Cone</h2></a>
<p>Constructor: Cone(<i>point1</i>, <i>point2</i>, <i>radius</i>, **|attributes|)</p>
<p><dl>
<dt><i>point1</i>, <i>point2</i></dt>
<dd><p>
the end points of the cylinder axis (vectors).
<i>point1</i> is the tip of the cone.</p></dd>
<dt><i>radius</i></dt>
<dd><p>
the radius (a positive number)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.PolyLines"><h2>Class PolyLines: Multiple connected lines</h2></a>
<p>Constructor: PolyLines(<i>points</i>, **|attributes|)</p>
<p><dl>
<dt><i>points</i></dt>
<dd><p>
a sequence of points to be connected by lines</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Line"><h2>Class Line: Line</h2></a>
<p>Constructor: Line(<i>point1</i>, <i>point2</i>, **|attributes|)</p>
<p><dl>
<dt><i>point1</i>, <i>point2</i></dt>
<dd><p>
the end points of the line (vectors)</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Polygons"><h2>Class Polygons: Polygons</h2></a>
<p>Constructor: Polygons(<i>points</i>, <i>index_lists</i>, **|attributes|)</p>
<p><dl>
<dt><i>points</i></dt>
<dd><p>
a sequence of points</p></dd>
<dt><i>index_lists</i></dt>
<dd><p>
a sequence of index lists, one for each polygon.
The index list for a polygon defines which points
in <i>points</i> are vertices of the polygon.</p></dd>
<dt><i>attributes</i></dt>
<dd><p>
any graphics object attribute
</p></dd>
</dl>
</p>
<hr width=70%>
<a name="Class:Scientific.Visualization.VPython.Material"><h2>Class Material: Material for graphics objects</h2></a>
<p>A material defines the color and surface properties of an object.</p>
<p>Constructor: Material(**|attributes|)</p>
<p>The attributes are "ambient_color", "diffuse_color", "specular_color",
"emissive_color", "shininess", and "transparency".
</p>
|