summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-spinner/pst-spinner-doc.tex
blob: b63926fe4a998bb34a17ad2afbaed02a61c66ffc (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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
%% $Id: pst-spinner-doc.tex 466 2017-05-23 05:41:09Z herbert $
%
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
    headexclude,footexclude,oneside]{pst-doc}
\listfiles
\usepackage{dtk-logos}
\usepackage[autostyle]{csquotes}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage[utf8]{inputenc}
\usepackage{pst-spinner,pst-tools,animate}
\let\belowcaptionskip\abovecaptionskip
%
\def\textat{\char064}%
\newdimen\fullWidth
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
    escapechar=§}

\def\bgImage{%
\psset{unit=0.75cm}
\begin{pspicture}(-4,-4)(4,4)
\psFidgetSpinner[colorMask=blue,linewidth=0.05,mask,customize,customizeMask,image=images/spirales-hsb.eps,rotation=-30]
\rput(0,0){\color{white}\textbf{PSTricks}}
\end{pspicture}}


\begin{document}
\title{\texttt{pst-spinner}\\
    \small v.\pstspinnerFV}
%\docauthor{Herbert Vo\ss}
\author{Manuel Luque\\Herbert Voß}
\date{\today}

\maketitle

\fullWidth=\linewidth
\advance\fullWidth by \marginparsep
\advance\fullWidth by \marginparwidth


\begin{abstract}
A fidget spinner is a type of stress-relieving toy. A basic fidget spinner consists of a bearing 
in the center of a design made from any of a variety of materials including brass, 
stainless steel, titanium, copper and plastic. The toy may help people who have trouble 
focusing or fidgeting by acting as a release mechanism for nervous energy or stress.~\parencite{wikipedia}
\vfill
\noindent
Thanks to:  
\end{abstract}

\clearpage
\tableofcontents


\clearpage

%\author{manuel.luque27@gmail.com}

\section{Introduction}
This package aims to propose a model of the fidget spinner gadget. It exists under different
forms, with 2, 3 poles and even more. We chosed the most popular model: the triple Fidget Spinner. The dimensions
of the model are linked to that of the ball bearings: outer diameter 22 mm and inner diameter 8 mm. The composite axis
of a quality ball bearing is in the center of an equilateral triangle at the tops of which are placed bearings
With balls identical to that of the axis but of any quality or colored rings. The contour of the object is
Consisting of perfectly connected circular arcs.

\section{Theory}
For calculations the Fidget Spinner is written in a circle of radius $R$. All other dimensions are deduced.
In the diagram $r_1$ is the outer radius of a ball bearing. A is the distance between a ball bearing and the edge
outside the object. $R_1 + a$ is the radius of the circle tangent to the circle of radius $R$, 
$r_2$ is the radius of the circle arc of
connection to the circles of radius $r_1 + a$ and to the central circle of radius $r_1 + 2a$.

\begin{center}
\psset{dimen=middle}
\begin{pspicture}(-6,-7)(6,5)
\psgrid[subgriddiv=0,griddots=10,gridlabels=0]
\pstVerb{/arctan {
dup 0 ge
   {1 atan}
   {neg 1 atan neg}
ifelse
} def
         /R1 4.5 def
         /r1 1.1 def
         /a1 R1 3 div r1 sub def
         /rho R1 r1 sub a1 sub def
         /r2 2 r1 mul a1 mul 3 a1 dup mul mul add rho dup mul add rho r1 a1 2 mul add mul sub
             rho 2 a1 mul sub div  def
         /rho2 r2 r1 add 2 a1 mul add def
         /alpha1 rho rho2 2 div sub rho2 3 sqrt mul 2 div div arctan def
         /beta1 rho rho2 add neg 3 sqrt rho2 rho sub mul div arctan def
         /alpha2 rho 2 div neg rho2 add 3 sqrt 2 div rho mul neg div arctan def
}%
\pscircle{! R1}
\pscircle{! rho}
\pnode(! 0 R1){A}
\pnode(!R1 3 sqrt mul -2 div R1 -2 div){B}
\pnode(!R1 3 sqrt mul 2 div R1 -2 div){C}
\pnode(! 0 rho){O1}
\pnode(!rho 3 sqrt mul -2 div rho -2 div){O2}
\pnode(!rho 3 sqrt mul 2 div rho -2 div){O3}
\pnode(! rho2 3 sqrt mul 2 div neg  rho2 2 div ){A'}
\pnode(! rho2 3 sqrt mul 2 div    rho2 2 div ){B'}
\pnode(! 0 rho2 neg){C'}
\pspolygon(A')(B')(C')
\pspolygon(O1)(O2)(O3)
\pscircle[linecolor={[rgb]{0 0.5 0}}]{!r1}
\pscircle{!r1 a1 add}
\pscircle{!r1 a1 2 mul add}
\pscircle[linecolor={[rgb]{0 0.5 0}}](O1){!r1}
\pscircle[linecolor={[rgb]{0 0.5 0}}](O2){!r1}
\pscircle[linecolor={[rgb]{0 0.5 0}}](O3){!r1}
\pscircle(O3){!r1 a1 add}
\pscircle(O1){!r1 a1 add}
\pscircle(O2){!r1 a1 add}
\psline(A)(O)
\psline(B)(O)
\psline(C)(O)
\psdots(O1)(O2)(O3)
\pscircle[linecolor=red,linestyle=dashed]{!rho2}
\pscircle[linecolor=red](A'){!r2}
\pscircle[linecolor=red](B'){!r2}
\pscircle[linecolor=red](C'){!r2}
\psdots[linecolor=red](A')(O1)(B')(O3)(C')(O2)
\pspolygon(A')(O1)(B')(O3)(C')(O2)
\psarc[linecolor=blue,linewidth=0.1]{->}(O1){!r1 a1 add}{!alpha1 neg}{!alpha1 180 add}
\psarcn[linecolor=red,linewidth=0.1]{->}(A'){!r2}{!alpha1}{!beta1}
\psarc[linecolor=blue,linewidth=0.1]{->}(O2){!r1 a1 add}{!180 beta1 add}{!alpha2}
\psarcn[linecolor=red,linewidth=0.1]{->}(C'){!r2}{!alpha2 180 sub}{!alpha2 neg}
\psarc[linecolor=blue,linewidth=0.1]{->}(O3){!r1 a1 add}{!alpha2 neg 180 add}{!360 beta1 sub}
\psarcn[linecolor=red,linewidth=0.1]{->}(B'){!r2}{!beta1 180 sub neg}{!alpha1 180 sub neg}
\uput[ul](0,0){$O$}
\uput[ul](O1){$O_1$}
\uput[d](O2){$O_2$}
\uput[d](O3){$O_3$}
\pcline{->}(O1)(!r1 30 cos mul rho r1 30 sin mul add)
\aput{:U}{$r_1$}
\rput(!r1 30 cos mul rho r1 30 sin mul add){\pcline{<->}(0,0)(!a1 30 cos mul a1 30 sin mul)\aput{:U}{$a$}}
\uput[u](A'){$O'_1$}
\uput[u](B'){$O'_3$}
\rput(B'){\pcline{->}(0,0)(! r2 30 cos mul r2 30 sin mul)\aput{:U}{$r_2$}}
\uput[d](C'){$O'_2$}
\end{pspicture}
\end{center}


\section{The Macro}

For calculations, the Fidget Spinner is written in a circle of radius R. All other dimensions are deduced.
The colors of the rings can be chosen as well as the background color of the object. This object can be customized with
a picture.
The command is: 

\begin{BDef}
\Lcs{psFidgetSpinner}\OptArgs\OptArg*{\Largr{$x_0,y_0$}}
\end{BDef}

with two optional arguments. If the \Largr{$x_0,y_0$} is missing then \Largr{$0,0$} is assumed as
the origin of the spinner.

\section{Optional arguments}

\subsection{The Radius \nxLkeyword{R}}
The radius \Lkeyword{R} of the circle in which the triple Fidget spinner is inscribed. It is preset to \nxLkeyword{R=3.9}.
\subsection{The colors}

The colors with their default value. They are numbered in the order: central bearing, peripheral rings,
and central cap.

  \begin{itemize}
    \item \Lkeyset{color0=honeydew}
    \item \Lkeyset{color1=red}
    \item \Lkeyset{color2=green}
    \item \Lkeyset{color3=blue}
    \item \Lkeyset{colorMask=honeydew}
  \end{itemize}

\subsection{Rotation}
With the optional argument \Lkeyword{rotation} the output of the spinner can be rotated.

\subsection{\nxLkeyword{mask}} 
\Lkeyword{mask} is a boolean value to customize the object with an image in eps format. Preset to \false.

\subsection{\nxLkeyword{customizeMask}}
\Lkeyword{customizeMask} is a boolean value. When set to \true\  the image is also printed on the cap of the central ball roll.

\subsection{\nxLkeyword{image}} 
The keyword \Lkeyword{image} defines the name including the path  of the image and is preset to empty.



\subsection{Background color}
The background color is set with the default PSTricks parameter \Lkeyword{fillcolor} and
the linecolor and linewidth with \Lkeyword{linecolor} and \Lkeyword{linewidth}.


\section{examples}


\begin{LTXexample}[width=0.6\linewidth,frame=,pos=r]
\begin{pspicture}(-4,-4)(4,4)
\psgrid[style=mmpaper](-4,-4)(4,4)
\psFidgetSpinner[
  fillcolor=cyan!10,
  linewidth=0.05,mask]
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=0.6\linewidth,frame=,pos=r]
\begin{pspicture}(-4,-4)(5,4)
\psgrid[subgriddiv=5,
 gridlabels=0,
 gridwidth=1pt,
 gridcolor=orange,
 subgridwidth=0.1pt,
 subgridcolor=orange](-4,-4)(5,4)
\psFidgetSpinner[
  fillcolor=cyan!10,
  linewidth=0.05,
  mask=false](1,0)
\end{pspicture}
\end{LTXexample}





\begin{LTXexample}[width=0.6\linewidth,frame=,pos=r]
\begin{pspicture}(-4,-4)(4,4)
\psgrid[subgriddiv=5,
  gridlabels=0,
  gridwidth=1pt,
  gridcolor=orange,
  subgridwidth=0.1pt,
  subgridcolor=orange](-4,-4)(4,4)
\psFidgetSpinner[colorMask=blue,
  linewidth=0.05,mask,customize,
  customizeMask,
  image=images/spirales-hsb.eps]
\rput(0,0){\color{white}\textbf{PSTricks}}
\end{pspicture}
\end{LTXexample}



\begin{LTXexample}[width=0.6\linewidth,frame=,pos=r]
\begin{pspicture}(-4,-4)(4,4)
\psgrid[subgriddiv=5,
  gridlabels=0,
  gridwidth=1pt,
  gridcolor=orange,
  subgridwidth=0.1pt,
  subgridcolor=orange](-4,-4)(4,4)
\psFidgetSpinner[colorMask=blue,linewidth=0.05,
  mask,customize,customizeMask,
  image=images/spirales-hsb.eps,
  rotation=-30]
\rput(0,0){\color{white}\textbf{PSTricks}}
\end{pspicture}
\end{LTXexample}


\begin{center}
\begin{animateinline}[controls,loop,
                     begin={\begin{pspicture}(-4,-4)(4,4)},
                     end={\end{pspicture}}]{25}% 25 images/s
\multiframe{72}{i=0+5}{%
\psgrid[subgriddiv=5,%
  	gridlabels=0,%
  	gridwidth=1pt,%
  	gridcolor=orange,
    subgridwidth=0.1pt,%
    subgridcolor=orange](-4,-4)(4,4)
\rput{\i}{\psFidgetSpinner[R=3.9,fillcolor=cyan!10,linewidth=0.05,mask]}
\rput(0,0){\textbf{PSTricks}}
}
\end{animateinline}
\end{center}

\begin{verbatim}
\begin{animateinline}[
  controls,loop,
  begin={\begin{pspicture}(-4,-4)(4,4)},
  end={\end{pspicture}}]{25}% 25 images/s
\multiframe{72}{i=0+5}{%
\psgrid[subgriddiv=5,
  gridlabels=0,  	
  gridwidth=1pt,
  gridcolor=orange,
  subgridwidth=0.1pt,
  subgridcolor=orange](-4,-4)(4,4)
\rput{\i}{\psFidgetSpinner[R=3.9,fillcolor=cyan!10,linewidth=0.05,mask]}
\rput(0,0){\textbf{PSTricks}}}
\end{animateinline}
\end{verbatim}

\iffalse

\begin{center}
\begin{animateinline}[controls,loop,
                     begin={\begin{pspicture}(-4,-4)(4,4)},
                     end={\end{pspicture}}]{25}% 25 images/s
\multiframe{72}{i=0+5}{%
\psgrid[subgriddiv=5,
  gridlabels=0,
  gridwidth=1pt,
  gridcolor=orange,
  subgridwidth=0.1pt,
  subgridcolor=orange](-4,-4)(4,4)
\psFidgetSpinner[R=3.9,colorMask=blue,linewidth=0.05,mask,customize,
  customizeMask,image=images/spirales-hsb.eps,rotation=\i]
\rput(0,0){\color{white}\textbf{PSTricks}}}
\end{animateinline}
\end{center}

\begin{verbatim}
\begin{animateinline}[controls,loop,
                     begin={\begin{pspicture}(-4,-4)(4,4)},
                     end={\end{pspicture}}]{25}% 25 images/s
\multiframe{72}{i=0+5}{%
\psgrid[subgriddiv=5,
  gridlabels=0,
  gridwidth=1pt,
  gridcolor=orange,
  subgridwidth=0.1pt,
  subgridcolor=orange](-4,-4)(4,4)
\psFidgetSpinner[R=3.9,colorMask=blue,linewidth=0.05,mask,customize,customizeMask,
     image=images/spirales-hsb.eps,rotation=\i]
\rput(0,0){\color{white}\textbf{PSTricks}}}
\end{animateinline}
\end{verbatim}

\fi


\clearpage
\section{List of all optional arguments for \texttt{pst-spinner}}

\xkvview{family=pst-spinner,columns={key,type,default}}


\nocite{*}
\bgroup
\RaggedRight
\printbibliography
\egroup

\printindex


\end{document}