Drawing with TubePlot: Difference between revisions
From Knot Atlas
Jump to navigationJump to search
DrorsRobot (talk | contribs) No edit summary |
No edit summary |
||
(18 intermediate revisions by 8 users not shown) | |||
Line 5: | Line 5: | ||
<!--$$?TubePlot$$--> |
<!--$$?TubePlot$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{HelpLine| |
|||
{{Help1|n=1|s=TubePlot}} |
|||
n = 2 | |
|||
⚫ | TubePlot[gamma, {t, t0, t1}, r, opts] plots the space curve gamma with the variable t running from t0 to t1, as a tube of radius r. The available options are TubeSubdivision, TubeFraming and TubePlotPrelude. All other options are passed on to Graphics3D. TubePlot[TorusKnot[m, n], opts] produces a tube plot of the (m,n) torus knot. |
||
in = <nowiki>TubePlot</nowiki> | |
|||
{{Help2}} |
|||
⚫ | out= <nowiki>TubePlot[gamma, {t, t0, t1}, r, opts] plots the space curve gamma with the variable t running from t0 to t1, as a tube of radius r. The available options are TubeSubdivision, TubeFraming and TubePlotPrelude. All other options are passed on to Graphics3D. TubePlot[TorusKnot[m, n], opts] produces a tube plot of the (m,n) torus knot.</nowiki>}} |
||
<!--END--> |
<!--END--> |
||
Line 14: | Line 15: | ||
<!--$$Show[TubePlot[{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.1]]$$--> |
<!--$$Show[TubePlot[{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.1]]$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{Graphics| |
|||
{{InOut1|n=2}} |
|||
n = 3 | |
|||
in = <nowiki>Show[TubePlot[{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.1]]</nowiki> | |
|||
{{InOut2|n=2}}<pre style="border: 0px; padding: 0em"><nowiki>-Graphics3D-</nowiki></pre> |
|||
img= Drawing_with_TubePlot_Out_3.gif | |
|||
{{InOut3}} |
|||
out= <nowiki>-Graphics3D-</nowiki>}} |
|||
<!--END--> |
<!--END--> |
||
<!--$$?TubeSubdivision$$--> |
<!--$$?TubeSubdivision$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{HelpLine| |
|||
{{Help1|n=3|s=TubeSubdivision}} |
|||
n = 4 | |
|||
⚫ | |||
in = <nowiki>TubeSubdivision</nowiki> | |
|||
{{Help2}} |
|||
⚫ | |||
<!--END--> |
<!--END--> |
||
<!--$$?TubeFraming$$--> |
<!--$$?TubeFraming$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{HelpLine| |
|||
{{Help1|n=4|s=TubeFraming}} |
|||
n = 5 | |
|||
⚫ | TubeFraming is an option for TubePlot. TubePlot[gamma, {t, __}, _, TubeFraming -> n] sets the framing of the tube (visible when TubeSubdivision -> {l, m} with small m) to be the vector n, which in itself may be a function of t. Thus TubeFraming -> {0,0,1} is "blackboard framing". TubeFraming -> Normal (default) uses the normal vector of the curve gamma. |
||
in = <nowiki>TubeFraming</nowiki> | |
|||
{{Help2}} |
|||
⚫ | out= <nowiki>TubeFraming is an option for TubePlot. TubePlot[gamma, {t, __}, _, TubeFraming -> n] sets the framing of the tube (visible when TubeSubdivision -> {l, m} with small m) to be the vector n, which in itself may be a function of t. Thus TubeFraming -> {0,0,1} is "blackboard framing". TubeFraming -> Normal (default) uses the normal vector of the curve gamma.</nowiki>}} |
||
<!--END--> |
<!--END--> |
||
<!--$$?TubePlotPrelude$$--> |
<!--$$?TubePlotPrelude$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{HelpLine| |
|||
{{Help1|n=5|s=TubePlotPrelude}} |
|||
n = 6 | |
|||
⚫ | TubePlotPrelude is an option for TubePlot. Its value is passed to Graphics3D before the main part of the plot, allowing to set various graphics options. For example, TubePlotPrelude -> EdgeForm[{}] will suppress the drawing of edges between the polygons making up the tube. The default is TubePlotPrelude -> {}. |
||
in = <nowiki>TubePlotPrelude</nowiki> | |
|||
{{Help2}} |
|||
⚫ | out= <nowiki>TubePlotPrelude is an option for TubePlot. Its value is passed to Graphics3D before the main part of the plot, allowing to set various graphics options. For example, TubePlotPrelude -> EdgeForm[{}] will suppress the drawing of edges between the polygons making up the tube. The default is TubePlotPrelude -> {}.</nowiki>}} |
||
<!--END--> |
<!--END--> |
||
Line 47: | Line 52: | ||
]]$$--> |
]]$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{Graphics| |
|||
{{InOut1|n=6}} |
|||
n = 7 | |
|||
<pre style="color: red; border: 0px; padding: 0em"><nowiki>Show[TubePlot[ |
|||
in = <nowiki>Show[TubePlot[ |
|||
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.3, TubeSubdivision -> {6, 3} |
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.3, TubeSubdivision -> {6, 3} |
||
]]</nowiki> |
]]</nowiki> | |
||
img= Drawing_with_TubePlot_Out_7.gif | |
|||
{{InOut2|n=6}}<pre style="border: 0px; padding: 0em"><nowiki>-Graphics3D-</nowiki></pre> |
|||
out= <nowiki>-Graphics3D-</nowiki>}} |
|||
{{InOut3}} |
|||
<!--END--> |
<!--END--> |
||
Line 63: | Line 69: | ||
]]$$--> |
]]$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{Graphics| |
|||
{{InOut1|n=7}} |
|||
n = 8 | |
|||
<pre style="color: red; border: 0px; padding: 0em"><nowiki>Show[TubePlot[ |
|||
in = <nowiki>Show[TubePlot[ |
|||
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.2, |
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.2, |
||
TubeSubdivision -> {50, 2}, |
TubeSubdivision -> {50, 2}, |
||
TubeFraming -> {Cos[2t]Cos[t], Cos[2t]Sin[t], Sin[3t]} |
TubeFraming -> {Cos[2t]Cos[t], Cos[2t]Sin[t], Sin[3t]} |
||
]]</nowiki> |
]]</nowiki> | |
||
img= Drawing_with_TubePlot_Out_8.gif | |
|||
{{InOut2|n=7}}<pre style="border: 0px; padding: 0em"><nowiki>-Graphics3D-</nowiki></pre> |
|||
out= <nowiki>-Graphics3D-</nowiki>}} |
|||
{{InOut3}} |
|||
<!--END--> |
<!--END--> |
||
Line 84: | Line 91: | ||
]]$$--> |
]]$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{Graphics| |
|||
{{InOut1|n=8}} |
|||
n = 9 | |
|||
<pre style="color: red; border: 0px; padding: 0em"><nowiki>Show[TubePlot[ |
|||
in = <nowiki>Show[TubePlot[ |
|||
{Cos[2t], Sin[2t], 0} + |
{Cos[2t], Sin[2t], 0} + |
||
0.5{Cos[3t]Cos[2t], Cos[3t]Sin[2t], -Sin[3t]}, |
0.5{Cos[3t]Cos[2t], Cos[3t]Sin[2t], -Sin[3t]}, |
||
Line 92: | Line 100: | ||
TubePlotPrelude -> EdgeForm[{}], |
TubePlotPrelude -> EdgeForm[{}], |
||
Boxed -> False, ViewPoint -> {0,0,1} |
Boxed -> False, ViewPoint -> {0,0,1} |
||
]]</nowiki> |
]]</nowiki> | |
||
img= Drawing_with_TubePlot_Out_9.gif | |
|||
{{InOut2|n=8}}<pre style="border: 0px; padding: 0em"><nowiki>-Graphics3D-</nowiki></pre> |
|||
out= <nowiki>-Graphics3D-</nowiki>}} |
|||
{{InOut3}} |
|||
<!--END--> |
<!--END--> |
||
Line 101: | Line 109: | ||
<!--$$Show[TubePlot[TorusKnot[3, 5]]]$$--> |
<!--$$Show[TubePlot[TorusKnot[3, 5]]]$$--> |
||
<!--Robot Land, no human edits to "END"--> |
<!--Robot Land, no human edits to "END"--> |
||
{{Graphics| |
|||
{{InOut1|n=9}} |
|||
n = 10 | |
|||
in = <nowiki>Show[TubePlot[TorusKnot[3, 5]]]</nowiki> | |
|||
{{InOut2|n=9}}<pre style="border: 0px; padding: 0em"><nowiki>-Graphics3D-</nowiki></pre> |
|||
img= Drawing_with_TubePlot_Out_10.gif | |
|||
{{InOut3}} |
|||
out= <nowiki>-Graphics3D-</nowiki>}} |
|||
<!--END--> |
<!--END--> |
||
<span id=Standalone_TubePlot> |
|||
\subsubsection{Standalone {\tt TubePlot}} |
|||
==== Standalone <code>TubePlot</code> ==== |
|||
</span> |
|||
There may be some independent interest in the routine |
There may be some independent interest in the routine <code>TubePlot</code>, and hence it is available also as an independent package. Here it is: [[Media:TubePlot.m|TubePlot.m]] ([[Image:TubePlot.m|file description]]). |
||
hence it is available also as an independent package. \latexhtml{See the |
|||
online version of this manual.}{Here it is: |
|||
\hlink{../Extras/TubePlot.m}{\tt TubePlot.m}.} |
Latest revision as of 17:24, 21 February 2013
(For In[1] see Setup)
|
Thus here's a thin unknot:
In[3]:=
|
Show[TubePlot[{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.1]]
|
Out[3]=
|
-Graphics3D-
|
|
|
|
Here's the same unknot, made thicker and not as smooth:
In[7]:=
|
Show[TubePlot[
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.3, TubeSubdivision -> {6, 3}
]]
|
Out[7]=
|
-Graphics3D-
|
Let's play with the framing now:
In[8]:=
|
Show[TubePlot[
{Cos[t], Sin[t], 0}, {t, 0, 2Pi}, 0.2,
TubeSubdivision -> {50, 2},
TubeFraming -> {Cos[2t]Cos[t], Cos[2t]Sin[t], Sin[3t]}
]]
|
Out[8]=
|
-Graphics3D-
|
Here's an example that uses a prelude and passes options on to Graphics3D
:
The last example serves as the basis for the definition of TubePlot[TorusKnot[m, n]]
. Here's a final example:
In[10]:=
|
Show[TubePlot[TorusKnot[3, 5]]]
|
Out[10]=
|
-Graphics3D-
|
Standalone TubePlot
There may be some independent interest in the routine TubePlot
, and hence it is available also as an independent package. Here it is: TubePlot.m (File:TubePlot.m).