summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-turtle/pst-turtle-doc.tex
blob: ccd26f5813f384169ec88f8e8447f109f5151184 (plain)
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
%% $Id: pst-turtle-doc.tex 1093 2019-10-02 11:28:36Z herbert $
\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,
   headings=small, headinclude=false,footinclude=false,oneside]{pst-doc}
\usepackage{pst-turtle}
\let\pstTurtleFV\fileversion
\renewcommand\bgImage{}

%\usepackage[style=dtk]{biblatex}
\addbibresource{pst-turtle-doc.bib}

\begin{document}

\title{\texttt{pst-turtle}}
\subtitle{Turtle graphics; v.\pstTurtleFV}
\author{Herbert Vo\ss}
\docauthor{}
\date{\today}
\maketitle

\tableofcontents

\clearpage

\begin{abstract}
\noindent
\LPack{pst-turtle} loads by default the following packages: \LPack{pstricks}, 
and \LPack{pst-xkey}.
All should be already part of your local \TeX\ installation. If not, or in case
of having older versions, go to \url{http://www.CTAN.org/} and load the newest version.

\vfill\noindent
Thanks to \\

\end{abstract}


\section{Usage}

\begin{BDef}
\Lcs{psTurtle}\OptArgs\Largr{$x_0,y_0$}\Largb{Turtle code}
\end{BDef}

The turle commands must be in PostScript notation, where you can use the
short or long version of the commands:

\begin{verbatim}
/bk { back } bind def
/fd { forward } bind def
/lt { left } bind def
/pd { pendown } bind def
/pu { penup } bind def
/rt { right } bind def
\end{verbatim}

The default unit is cm.

\bigskip
\begin{LTXexample}[width=4cm,pos=l]
\begin{pspicture}[showgrid](3,3)
\psTurtle[linewidth=2pt,arrows=->](0,0){ 3 forward }
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=4cm,pos=l]
\begin{pspicture}[showgrid](3,3)
\psTurtle[linewidth=2pt,arrows=->](0,0){ 
  3 fd 
  90 left 3 fd }
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=4cm,pos=l]
\begin{pspicture}[showgrid](3,3)
\psTurtle[linewidth=2pt,arrows=->](0,0){ 
  3 fd 
  90 left 3 fd 
  90 left 3 fd
  135 left 18 sqrt fd}
\end{pspicture}
\end{LTXexample}


\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](0.8,0){ 
  5 { 2.5 fd 72 left } repeat
}
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](2,1){ 
  5 { 72 left 1 fd 72 right 1 fd 72 left} repeat
}
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](2,0){ 
  /Angle { 360 7 div } bind def
  7 { Angle left 1 fd Angle right 1 fd Angle left} repeat
}
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](2,2){ 
  /Angle { 360 7 div } bind def
  7 { Angle left 1 fd Angle 3 mul right 1 fd Angle left} repeat
}
\end{pspicture}
\end{LTXexample}


\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](2,1){ 
  /Angle 40 def
  75 { 0.25 fd Angle left /Angle Angle 0.5 sub def } repeat
}
\end{pspicture}
\end{LTXexample}

\bigskip
\begin{LTXexample}[width=5cm,pos=l]
\begin{pspicture}[showgrid](4,4)
\psTurtle[linewidth=2pt](0,3.5){ 
  5 { 3 fd 144 right } repeat
}
\end{pspicture}
\end{LTXexample}


\bigskip
\begin{LTXexample}[width=6cm,pos=l]
\begin{pspicture}[showgrid](5,5)
\psTurtle[linewidth=0.2pt](1,1.75){ 
  75 { 3.5 fd 123 left } repeat
}
\end{pspicture}
\end{LTXexample}


\bigskip
\begin{LTXexample}[width=11cm,pos=l]
\begin{pspicture}[showgrid](10,10)
\psTurtle[linewidth=0.5pt](5,5){ 
  /L 1 def
  150 { L fd 120 left L fd 120 left L fd /L L 0.03 add def 1.25 rotate } repeat
}
\end{pspicture}
\end{LTXexample}




\iffalse
\def\a{3 }
\begin{pspicture}[showgrid](12,6)
\psset{linecolor=red,linewidth=1.5pt,unit=1cm}
\psTurtle(0,0){
  90 left \a 1.5 mul fd 159 rt \a fd 120 lt \a fd 120 lt \a fd
  pu \a bk pd -125 rt \a fd 90 lt \a fd 90 lt \a fd 90 lt \a fd
  pu 90 lt \a fd 90 lt \a fd pd
  -37 lt \a fd 4 { 72 lt \a fd } repeat 
  pu 2 { 72 lt \a fd } repeat pd
  -152 lt \a fd 
}
%\psdot[dotscale=3](! Turtle8)
\end{pspicture}
\fi





%\clearpage
%\section{List of all optional arguments for \texttt{pst-turtle}}
%\xkvview{family=pst-turtle,columns={key,type,default}}

\bgroup
\RaggedRight
\nocite{*}
%\bibliographystyle{plain}
\printbibliography{pst-turtle-doc}
\egroup

\printindex

\end{document}