summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex97
1 files changed, 48 insertions, 49 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
index 46198942e5a..6c1187e0c33 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
@@ -7,97 +7,101 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Turtle Graphics Library}
\label{section-library-tutrle}
-
\begin{pgflibrary}{turtle}
- This little library defines some keys to create simple turtle
- graphics in the tradition of the Logo programming language. These
- commands are mostly for fun, but they can also be used for more
- ``serious'' business.
+ This little library defines some keys to create simple turtle graphics in
+ the tradition of the Logo programming language. These commands are mostly
+ for fun, but they can also be used for more ``serious'' business.
+ %
\begin{codeexample}[]
\tikz[turtle/distance=2mm]
\draw [turtle={home,forward,right,forward,left,forward,left,forward}];
\end{codeexample}
+ %
\end{pgflibrary}
-Even though the |turtle| keys looks like an option, it uses the
-|insert path| option internally to produce a path.
+Even though the |turtle| keys looks like an option, it uses the |insert path|
+option internally to produce a path.
-The basic drawing model behind the turtle graphics is very simple:
-There is a (virtual) \emph{turtle} that crawls around the page,
-thereby extending the path. The turtle always heads in a certain
-direction. When you move the turtle forward, you extend the path in
-that direction; turning the turtle just changes the direction, it does
-not cause anything to be drawn.
+The basic drawing model behind the turtle graphics is very simple: There is a
+(virtual) \emph{turtle} that crawls around the page, thereby extending the
+path. The turtle always heads in a certain direction. When you move the turtle
+forward, you extend the path in that direction; turning the turtle just changes
+the direction, it does not cause anything to be drawn.
-The turtle always moves relative to the last current point of the
-path and you can mix normal path commands with turtle
-commands. However, the direction of the turtle is managed
-independently of other path commands.
+The turtle always moves relative to the last current point of the path and you
+can mix normal path commands with turtle commands. However, the direction of
+the turtle is managed independently of other path commands.
\begin{key}{/tikz/turtle=\meta{keys}}
- This key executes the \meta{keys} with the current key path set to
- |/tikz/turtle|.
+ This key executes the \meta{keys} with the current key path set to
+ |/tikz/turtle|.
+ %
\begin{codeexample}[]
\tikz[turtle/distance=2mm]
\draw [turtle={home,fd,rt,fd,lt,fd,lt,fd}];
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/turtle/home}
- Places the turtle at the origin and lets it head upward.
+ Places the turtle at the origin and lets it head upward.
\end{key}
\begin{key}{/tikz/turtle/forward=\meta{distance} (default \normalfont see text)}
- Makes the turtle move forward by the given \meta{distance}. If no
- \meta{distance} is specified, the current value of the following key
- is used:
- \begin{key}{/tikz/turtle/distance=\meta{distance} (initially 1cm)}
- The default distance by which the turtle advances.
- \end{key}
- ``Moving forward the turtle'' actually means that, relative to the
- current last point on the path, a point at the given \meta{distance}
- in the direction the turtle is currently heading is computed. Then,
- the operation |to[turtle/how]| is used to extend the path to this
- point.
- \begin{stylekey}{/tikz/turtle/how (initially \normalfont empty)}
- This style can set up the |to path| used by turtles. By setting
- this style you can change the to-path:
+ Makes the turtle move forward by the given \meta{distance}. If no
+ \meta{distance} is specified, the current value of the following key is
+ used:
+ %
+ \begin{key}{/tikz/turtle/distance=\meta{distance} (initially 1cm)}
+ The default distance by which the turtle advances.
+ \end{key}
+ %
+ ``Moving forward the turtle'' actually means that, relative to the current
+ last point on the path, a point at the given \meta{distance} in the
+ direction the turtle is currently heading is computed. Then, the operation
+ |to[turtle/how]| is used to extend the path to this point.
+ %
+ \begin{stylekey}{/tikz/turtle/how (initially \normalfont empty)}
+ This style can set up the |to path| used by turtles. By setting this
+ style you can change the to-path:
+ %
\begin{codeexample}[]
\tikz \draw [turtle={how/.style={bend left},home,forward,right,forward}];
-\end{codeexample}
- \end{stylekey}
+\end{codeexample}
+ \end{stylekey}
\end{key}
\begin{key}{/tikz/turtle/fd}
- An abbreviation for the |forward| key.
+ An abbreviation for the |forward| key.
\end{key}
\begin{key}{/tikz/turtle/back=\meta{distance} (default \normalfont see text)}
- This has the same effect as a |turtle/forward| for the negated
- \meta{distance} value.
+ This has the same effect as a |turtle/forward| for the negated
+ \meta{distance} value.
\end{key}
\begin{key}{/tikz/turtle/bk}
- An abbreviation for the |back| key.
+ An abbreviation for the |back| key.
\end{key}
\begin{key}{/tikz/turtle/left=\meta{angle} (default 90)}
- Turns the turtle left by the given angle.
+ Turns the turtle left by the given angle.
\end{key}
\begin{key}{/tikz/turtle/lt}
- An abbreviation for the |left| key.
+ An abbreviation for the |left| key.
\end{key}
\begin{key}{/tikz/turtle/right=\meta{angle} (default 90)}
- Turns the turtle right by the given angle.
+ Turns the turtle right by the given angle.
\end{key}
\begin{key}{/tikz/turtle/rt}
- An abbreviation for the |right| key.
+ An abbreviation for the |right| key.
\end{key}
Turtle graphics are especially nice in conjunction with the |\foreach|
@@ -111,8 +115,3 @@ statement:
[turtle={forward,right=144}]
};
\end{codeexample}
-
-\endinput
-
-
-