Skip to content

Commit 56e77c5

Browse files
committed
Improved attach_arrow
1 parent 8514907 commit 56e77c5

31 files changed

+118
-147
lines changed

ForInstalledPython/glow.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GlowScriptOffline/glowscript_libraries/glow.3.2.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GlowScriptOffline3.2.zip

-61 Bytes
Binary file not shown.

build_original_no_overload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
##shader_file = "\n".join(shader_file)
3434
##open("lib/glow/shaders.gen.js", "wb").write(shader_file)
3535

36-
version = "3.1"
36+
version = "3.2"
3737
# TODO: Extract this information from run.js
3838

3939
glowscript_libraries = {

docs/VPythonDocs/MathJax.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
<div id="content">
3131
<!-- InstanceBeginEditable name="content" -->
3232
<div>
33-
<h1 class="Heading-1"><font color="#0000A0">Math displays using LaTeX</font> - GlowScript VPython only</h1>
33+
<h1 class="Heading-1"><font color="#0000A0">Math displays using LaTeX</font> - Web VPython only</h1>
3434
</div>
3535
<div>
36-
<p class="Normal">In GlowScript VPython (but not currently in VPython 7) you can display complex mathematical expressions expressed in the widely used math editing format, <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>. Here is <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/LaTexMathDisplay" target="_blank">an example</a></strong>. The LaTeX capability is provided by <a href="http://www.mathjax.org/" target="_blank">MathJax</a>, which is imported by GlowScript. For example, consider this mathematical display:</p>
36+
<p class="Normal">In Web VPython (but not currently in VPython 7) you can display complex mathematical expressions expressed in the widely used math editing format, <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>. Here is <strong><a href="https://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/LaTexMathDisplay" target="_blank">an example</a></strong>. The LaTeX capability is provided by <a href="http://www.mathjax.org/" target="_blank">MathJax</a>, which is imported by Web VPython. For example, consider this mathematical display:</p>
3737
<p class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/MathJax.jpg" width="350" height="48" alt="equation" /></p>
38-
<p class="Normal">You can display this in the caption of an existing GlowScript canvas with the following statements:</p>
38+
<p class="Normal">You can display this in the caption of an existing Web VPython canvas with the following statements:</p>
3939
<p class="program"> box()<br />
4040
scene.caption = &quot;Final kinetic energy = \\( \\dfrac {1} {2}mv_i^{2}+\\int _{i}^{f}\\vec{F}\\circ d \\vec{r} \\)&quot;<br />
4141
<br />

docs/VPythonDocs/VisualIntro.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1 class="Title" align="center"> <font color="#FF0000">Simple 3D Programming
3434
Using VPython</font> </h1>
3535
<div>
3636
<h3 class="Heading-1"> <font color="#0000A0">I. Getting started</font></h3>
37-
<p class="Normal">To write a VPython program in the browser, sign in at glowscript.org, click the link to your programs, then click Create New Program. A blank edit page will open with a header line that says something like &quot;GlowScript 3.0 VPython&quot;. Start typing your program on the second line. Click &quot;Run this program&quot; to try out your program.</p>
37+
<p class="Normal">To write a VPython program in the browser, sign in at glowscript.org, click the link to your programs, then click Create New Program. A blank edit page will open with a header line that says something like &quot;GlowScript 3.2 VPython&quot;. Start typing your program on the second line. Click &quot;Run this program&quot; to try out your program.</p>
3838
</div>
3939
<div>
4040
<h3 class="Heading2"> <font color="#0000A0">The canvas</font></h3>
@@ -134,8 +134,8 @@ <h3 class="Heading-1"> <font color="#0000A0">III. Simple Python Programming</fon
134134

135135
<h3 class="Heading2"><font color="#0000A0">Using the 3D Graphics Module</font></h3>
136136

137-
<p class="Normal"> The necessary first line of your program is created for you, and looks like this, if the current version is 3.0:</p>
138-
<p class="program"> GlowScript 3.0 VPython</p>
137+
<p class="Normal"> The necessary first line of your program is created for you, and looks like this, if the current version is 3.2:</p>
138+
<p class="program"> GlowScript 3.2 VPython</p>
139139

140140
<h3 class="Heading2"><font color="#0000A0">Comments</font></h3>
141141
<p class="Normal"> A comment in a Python program starts with &quot;#&quot;</p>

docs/VPythonDocs/canvas.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h1 class="Heading-1"> <font color="#0000A0">Controlling One or More VPython
4949
<p class="Normal"><span class="attributes"><strong>Selecting a canvas:</strong> By default, any objects that you create go into the most recently created canvas, such as <span class="attribute">scene</span>. If you create another canvas <span class="attribute">cvs</span>, new objects will go into the <span class="attribute">cvs</span> canvas. You can later execute <span class="attribute">scene.select()</span> to make the <span class="attribute">scene</span> canvas the one that new objects go into.</span> You can find out which canvas is selected: <span class="attributes"><span class="attribute">current = </span><font color="#FF0000">canvas.get_selected()</font> returns
5050
a reference to the canvas into which objects are currently being
5151
created.</span> You can also specify which canvas to use when creating an object, as in box(canvas=cvs, .....).</p>
52-
<p class="Normal">In GlowScript VPython you can say canvas.selected = cvs, or current = canvas.selected, but unfortunately it doesn't seem possible to implement this syntax in VPython 7, so for compatibiity between GlowScript VPython and VPython 7 you may wish to use cvs.select() and canvas.get_selected() in GlowScript programs.</p>
52+
<p class="Normal">In Web VPython you can say canvas.selected = cvs, or current = canvas.selected, but unfortunately it doesn't seem possible to implement this syntax in VPython 7, so for compatibiity between Web VPython and VPython 7 you may wish to use cvs.select() and canvas.get_selected() in Web VPython programs.</p>
5353
<p class="Normal">Here is a summary of what determines in which of several possible 3D canvases an object such as a box or sphere will be placed:</p>
5454
<p class="program">scene = canvas() # automatic; you don't need to say this<br />
5555
box(...) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# will appear in the canvas named &quot;scene&quot;<br />
@@ -93,7 +93,7 @@ <h1 class="Heading-1"> <font color="#0000A0">Controlling One or More VPython
9393
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 2*ball.pos<br />
9494
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scene.camera.follow(f)</p>
9595
<p class="attributes"></p>
96-
<p class="attributes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, in GlowScript VPython you can specify an &quot;anonymous&quot; (unnamed) function, though this does not work in true Python:</p>
96+
<p class="attributes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alternatively, in Web VPython you can specify an &quot;anonymous&quot; (unnamed) function, though this does not work in true Python:</p>
9797
<p class="program">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scene.camera.follow(def ():<br />
9898
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 2*ball.pos<br />
9999
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</p>

docs/VPythonDocs/compound.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</table>
4545
</div>
4646
<div>
47-
<p class="Normal">The <strong>compound</strong> object lets you group objects together and manage them as though they were one object, by specifying in the usual way <span class="attribute">pos</span>, <span class="attribute">color</span>, <span class="attribute">size</span> (or <span class="attribute">length</span>, <span class="attribute">width</span>, <span class="attribute">height</span>), <span class="attribute">axis</span>, <span class="attribute">up</span>, <span class="attribute">opacity</span>, <span class="attribute">shininess</span>, <span class="attribute">emissive</span>, and <span class="attribute">texture</span>. Moreover, the display of a complicated compound object is faster than displaying the individual objects one at a time. (In GlowScript version 2.1 the <strong><a href="compound2.1.html" target="_blank">details were somewhat different</a></strong>.)</p>
47+
<p class="Normal">The <strong>compound</strong> object lets you group objects together and manage them as though they were one object, by specifying in the usual way <span class="attribute">pos</span>, <span class="attribute">color</span>, <span class="attribute">size</span> (or <span class="attribute">length</span>, <span class="attribute">width</span>, <span class="attribute">height</span>), <span class="attribute">axis</span>, <span class="attribute">up</span>, <span class="attribute">opacity</span>, <span class="attribute">shininess</span>, <span class="attribute">emissive</span>, and <span class="attribute">texture</span>. Moreover, the display of a complicated compound object is faster than displaying the individual objects one at a time. (In Web VPython version 2.1 the <strong><a href="compound2.1.html" target="_blank">details were somewhat different</a></strong>.)</p>
4848
<p class="Normal">The object shown above is a compound of a cylinder and a box:</p>
4949
<p class="program">handle = cylinder( size=vector(1,.2,.2), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
5050
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; color=vector(0.72,0.42,0) )<br />

docs/VPythonDocs/controls.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h1><font color="#0000A0">Widgets:
150150
<p class="Header"><strong><font color="#0000a0">winput</font></strong></p>
151151
<p class="Normal">The <strong>winput</strong> object (widget input) displays a box in which the user can input a numeric expression or text. The user must select the text either by clicking in the box or by using the tab key. <em>A function bound to a winput object is executed if the user presses Enter or Tab or clicks somewhere other than in a VPython canvas (clicks in a canvas are handled separately).</em></p>
152152
<p class="attributes"> <font color="#FF0000" class="attribute">pos</font> Position to which to append the widget (see &quot;Appending to anchor points&quot; below). Cannot be changed after creating the object.</p>
153-
<p class="attributes"><font color="#FF0000" class="attribute">bind</font> The name of the function to be called when the user presses Enter. Cannot be changed after creating the object. In GlowScript VPython, if no bind function is specified, a pop-up dialog box appears for the user to type some input; this no-bind version is not yet available with installed Python (VPython 7).</p>
153+
<p class="attributes"><font color="#FF0000" class="attribute">bind</font> The name of the function to be called when the user presses Enter. Cannot be changed after creating the object. In Web VPython, if no bind function is specified, a pop-up dialog box appears for the user to type some input; this no-bind version is not yet available with installed Python (VPython 7).</p>
154154
<p class="attributes"><font color="#FF0000" class="attribute">prompt</font> If bind is specified, the prompt text is displayed to the left of the input box, and this text is erased if the winput object is deleted. If no bind is specified, the prompt text is displayed above the place where the user types the input. This prompt option is not yet available with installed Python (VPython 7).</p>
155155
<p class="attributes"> <font color="#FF0000" class="attribute">type</font> &quot;numeric&quot; (the default) or &quot;string&quot;. If it is numeric, the user can input expressions such as 3+2*sqrt(5.2e4). An error message is displayed if there is something wrong with the expression, and the bound function is not called. Cannot be changed after creating the object.</p>
156156
<p class="attributes"><font color="#FF0000" class="attribute">width</font> The width of the winput box in pixels; default is 100. Cannot be changed after creating the object.</p>

docs/VPythonDocs/cylinder.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<p class="Normal"><strong>Studying this description of the cylinder object
4545
provides an overview of important aspects common to all of the
4646
VPython 3D objects, box, sphere, pyramid, etc. </strong>Additional details about how to orient an object using &quot;axis&quot; and &quot;up&quot; are found in the description of the <a href="box.html"><strong>box object</strong></a>. </p>
47-
<p class="Normal">This documentation explains how to use GlowScript VPython. If you prefer to write programs in JavaScript, see this <strong><a href="using_javascript.html">document</a></strong>.</p>
47+
<p class="Normal">This documentation explains how to use Web VPython. If you prefer to write programs in JavaScript, see this <strong><a href="using_javascript.html">document</a></strong>.</p>
4848
<p class="Normal"> <img src="VisualRef-1.gif" alt="cylinder" align="right" /> Here is an example
4949
of how to make a cylinder, naming it &quot;rod&quot; for future reference:</p>
5050

docs/VPythonDocs/delete.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1 class="Heading-1"> <font color="#0000A0">Deleting an Object</font></h1>
3535
<div>
3636
<p class="Normal">To hide a VPython object just make it invisible: <span class="attribute">ball.visible
3737
= False</span>. This does not delete the object from computer memory, and you can make it visible again later.</p>
38-
<p class="Normal">Currently it is not possible to use <span class="attribute">del ball</span> to delete a GlowScript VPython object.</p>
38+
<p class="Normal">Currently it is not possible to use <span class="attribute">del ball</span> to delete a Web VPython object.</p>
3939
</div>
4040
<div> </div>
4141
<!-- InstanceEndEditable -->

0 commit comments

Comments
 (0)