File: arrow.html

package info (click to toggle)
python-visual 3.2.9-4.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,796 kB
  • ctags: 2,664
  • sloc: cpp: 11,958; sh: 8,185; python: 3,709; ansic: 480; makefile: 311
file content (182 lines) | stat: -rw-r--r-- 6,423 bytes parent folder | download | duplicates (3)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 5.5/HTML Export Filter">

<LINK REL="STYLESHEET" HREF="VisualRef.css" CHARSET="ISO-8859-1" TYPE="text/css">

<TITLE> Description of Objects in VPython</TITLE>

</HEAD>

<BODY BGCOLOR="#ffffff">

<DIV CLASS="navigation"><table align="center" width="100%" cellpadding="0" cellspacing="2">

<tr>

      <td><A HREF="cylinder.html"><img src="icons/previous.gif" border="0" height="32"

  alt="Previous Page" width="32"></A></td>

      <td><A HREF="index.html"><img src="icons/up.gif" border="0" height="32"

  alt="Up One Level" width="32"></A></td>

      <td><A HREF="cone.html"><img src="icons/next.gif" border="0" height="32"

  alt="Next Page" width="32"></A></td>

<td align="center" width="100%">Visual Reference</td>

      <td><A HREF="index.html"><img src="icons/contents.gif" border="0" height="32"

  alt="Contents" width="32"></A></td>

      <td><img src="icons/blank.gif" border="0" height="32"

  alt="" width="32"></td>

      <td><img src="icons/blank.gif" border="0" height="32"

  alt="" width="32"></td>

</tr></table>

<b class="navlabel">Previous:</b> <a class="sectref" HREF="cylinder.html">The cylinder Object</A>

<b class="navlabel">Up:</b> <a class="sectref" HREF="index.html">Contents</A>

<b class="navlabel">Next:</b> <a class="sectref" HREF="cone.html">The cone Object</A>

<br><hr>

</DIV>

<DIV>

  <H1 CLASS="Heading-1"> <font color="#0000A0">The arrow Object</font></H1>

</DIV>

<DIV>

<P CLASS="Normal">

<IMG SRC="VisualRef-2.gif" ALIGN="RIGHT">

The arrow object has a straight box-shaped shaft with an arrowhead at one end. The following statement will display an arrow pointing parallel to the x axis:</P>

<DIV>

<H2 CLASS="program0">

pointer = arrow(pos=(0,2,1), axis=(5,0,0), shaftwidth=1)</H2>

    <P CLASS="Normal"> The arrow object has the following attributes and default 
      values, like those for cylinders: <span class="attribute">pos<font color="#000000"> 
      (0,0,0)</font></span>, <span class="attribute">x</span><span class="attribute"><font color="#000000"> 
      (0)</font></span>, <span class="attribute">y<font color="#000000">(0)</font></span>, 
      <span class="attribute">z<font color="#000000">(0)</font></span>, <span class="attribute">axis<font color="#000000"> 
      (1,0,0)</font></span>, <span class="attribute">length<font color="#000000"> 
      (1)</font></span>, <span class="attribute">color<font color="#000000"> (1,1,1) 
      which is color.white</font></span>, <span class="attribute">red<font color="#000000"> 
      (1)</font></span>, <span class="attribute">green<font color="#000000"> (1)</font></span>, 
      <span class="attribute">blue<font color="#000000"> (1)</font></span>, and 
      <span class="attribute">up<font color="#000000"> (0,1,0)</font></span>. 
      The <span class="attribute">up</span> attribute is significant for arrow 
      because the shaft and head have square cross sections, and setting the <EM CLASS="program"> 
      </EM><span class="attribute">up</span> attribute rotates the arrow about 
      its axis. Additional arrow attributes:</P>

    <P CLASS="attributes"> <span class="attribute">shaftwidth</span> By default, shaftwidth 

      = 0.1*(length of arrow)</P>

    <P CLASS="attributes"> <span class="attribute">headwidth</span> By default, headwidth 

      = 2*shaftwidth</P>

    <P CLASS="attributes"> <span class="attribute">headlength</span> By default, headlength 

      = 3*shaftwidth</P>

    <P CLASS="Normal"> Assigning any of these attributes to 0 makes it use defaults 
      based on the size of the arrow. If <span class="attribute">headlength</span> 
      becomes larger than half the length of the arrow, or the shaft becomes thinner 
      than 1/50 the length, the entire arrow is scaled accordingly.</P>
    <P CLASS="Normal">This default behavior makes the widths of very short arrows 
      shrink, and the widths of very long arrows grow (while displaying the correct 
      total length). If you prefer that <span class="attribute">shaftwidth</span> 
      and <span class="attribute">headwidth</span> not change as the arrow gets 
      very short or very long, set <span class="attribute">fixedwidth = 1</span>. 
      In this case the only adjustment that is made is that <span class="attribute">headlength</span> 
      is adjusted so that it never gets longer than half the total length, so 
      that the total length of the arrow is correct. This means that very short, 
      thick arrows look similar to a thumbtack, with a nearly flat head.</P>
    <P CLASS="Normal">Note that the <span class="attribute">pos</span> attribute 
      for cylinder, arrow, cone, and pyramid corresponds to one end of the object, 
      whereas for a box, sphere, or ring it corresponds to the center of the object. 
    </P>

    <P CLASS="Normal">&nbsp; </P>

  </DIV>

</DIV>

<DIV> </DIV>

<hr>

<DIV CLASS="navigation"><table align="center" width="100%" cellpadding="0" cellspacing="2">

<tr>

      <td><A HREF="cylinder.html"><img src="icons/previous.gif" border="0" height="32"

  alt="Previous Page" width="32"></A></td>

      <td><A HREF="index.html"><img src="icons/up.gif" border="0" height="32"

  alt="Up One Level" width="32"></A></td>

      <td><A HREF="cone.html"><img src="icons/next.gif" border="0" height="32"

  alt="Next Page" width="32"></A></td>

<td align="center" width="100%">Visual Reference</td>

      <td><A HREF="index.html"><img src="icons/contents.gif" border="0" height="32"

  alt="Contents" width="32"></A></td>

      <td><img src="icons/blank.gif" border="0" height="32"

  alt="" width="32"></td>

      <td><img src="icons/blank.gif" border="0" height="32"

  alt="" width="32"></td>

</tr></table>

<b class="navlabel">Previous:</b> <a class="sectref" HREF="cylinder.html">The cylinder Object</A>

<b class="navlabel">Up:</b> <a class="sectref" HREF="index.html">Contents</A>

<b class="navlabel">Next:</b> <a class="sectref" HREF="cone.html">The cone Object</A>

<br><hr>

</DIV>

</BODY>

</HTML>