You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="Normal"><imgsrc="VisualRef-2.gif" alt="arrow" 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>
<pclass="Normal"> The arrow object has the following attributes and
default values, like those for cylinders: <spanclass="attribute">pos<fontcolor="#000000"> (0,0,0)</font></span>, <spanclass="attribute">axis<fontcolor="#000000"> (1,0,0)</font></span>, <spanclass="attribute">length<fontcolor="#000000"> (1)</font></span>, <spanclass="attribute">color<fontcolor="#000000"> (1,1,1)
which is color.white</font></span>, <spanclass="attribute">red<fontcolor="#000000"> (1)</font></span>, <spanclass="attribute">green<fontcolor="#000000"> (1)</font></span>, <spanclass="attribute">blue<fontcolor="#000000"> (1)</font></span>,
and <spanclass="attribute">up<fontcolor="#000000"> (0,1,0)</font></span>.
As with <ahref="box.html">box</a>, the <spanclass="attribute">up</span> attribute
is significant for arrow because the shaft and head have square
cross sections, and setting the <emclass="program"></em><spanclass="attribute">up</span> attribute
rotates the arrow about its axis. Additional arrow attributes:</p>
<pclass="attributes"><spanclass="attribute">shaftwidth</span> By default, shaftwidth
= 0.1*(length of arrow)</p>
<pclass="attributes"><spanclass="attribute">headwidth</span> By default, headwidth
= 2*shaftwidth</p>
<pclass="attributes"><spanclass="attribute">headlength</span> By default, headlength
= 3*shaftwidth</p>
<pclass="Normal">Assigning <spanclass="attribute">shaftwidth = 0</span> makes it be the default (0.1 times the length of the arrow). If you don't explicitly set <spanclass="attribute">headwidth</span> or <spanclass="attribute">headlength</span>, its length is based as shown above on <spanclass="attribute">shaftwidth</span> (either the default or whatever value you specify for <spanclass="attribute">shaftwidth</span>). If <spanclass="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>
<pclass="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 <spanclass="attribute">shaftwidth</span> and <spanclass="attribute">headwidth</span> not
change as the arrow gets very short or very long, specify the desired <spanclass="attribute">shaftwidth</span>.
In this case the only adjustment that is made is that <spanclass="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>
<pclass="Normal">Note that the <spanclass="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>
<pclass="Normal">If you include <spanclass="attribute">make_trail=True</span> when you create the object, a trail will be left behind the object as you move it. For related options, see <ahref="trail.html"><strong>Leaving a Trail</strong></a>.</p>
<pclass="Normal">See <ahref="rotation.html"><strong>Rotating an Object</strong></a> for an easy way to change the orientation of an object.</p>
<pclass="Normal">See description of <ahref="options.html">Additional
Attributes</a> available for all 3D display objects.</p>