-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtikzlings-apes.sty
416 lines (409 loc) · 22.8 KB
/
tikzlings-apes.sty
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
% !TeX root = ./examples/ape.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% This package is part of the TikZlings package
%% A package to bring cute little animals and other beings into tikz
%% Maintained by samcarter
%%
%% Project repository and bug tracker:
%% https://github.com/samcarter/tikzlings
%%
%% Released under the LaTeX Project Public License v1.3c or later
%% See https://www.latex-project.org/lppl.txt
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{tikzlings-apes}[2025/01/05 version v2.2 Drawing apes in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
\newcommand*{\ape}[1][]{%
\begin{scope}%
\tikzset{/ape/.cd,#1}%
\ape@draw%
\end{scope}%
\thing[#1]%
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\UseHook{tikzlings/ape/foreground}
\UseHook{tikzlings/foreground}
\csname apehookforeground\endcsname
\csname tikzlinghookforeground\endcsname
}
\newif\ifape@threeD
\newif\ifape@handposition@hearnoevil
\newif\ifape@handposition@seenoevil
\newif\ifape@handposition@speaknoevil
\newif\ifape@handposition@clap
\newif\ifape@handposition@waving
\newif\ifape@back
\newif\ifape@contour
\newif\ifape@openmouth
\NewHook{tikzlings/ape/background}
\NewHook{tikzlings/ape/belly}
\NewHook{tikzlings/ape/body}
\NewHook{tikzlings/ape/foreground}
\tikzset{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Pass unknown keys on to tikz
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/ape/.search also={/tikz,/pgf,/thing},
/ape/.cd,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% body
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
body/.store in = \ape@body,
body = red!15!brown!80!black,
eyes/.store in = \ape@eyes,
eyes = \ape@body!40!black,
eye/.forward to = /ape/eyes,
skin/.store in = \ape@skin,
skin = \ape@body!50!gray,
nose/.store in = \ape@nose,
nose = \ape@skin!60!black,
mouth/.store in = \ape@mouth,
mouth = \ape@skin!50!black,
muzzle/.store in = \ape@muzzle,
muzzle = \ape@skin!80!white,
legs/.store in = \ape@legs,
legs = \ape@body!90!black,
leg/.forward to = /ape/legs,
arms/.store in = \ape@arms,
arms = \ape@body!95!black,
arm/.forward to = /ape/arms,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% options
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3D/.code = \ape@threeDtrue,
handposition/.code = \csname ape@handposition@#1true\endcsname,
kikazaru/.code = \ape@handposition@hearnoeviltrue,
mizaru/.code = \ape@handposition@seenoeviltrue,
iwazaru/.code = \ape@handposition@speaknoeviltrue,
%clap/.code = \ape@handposition@claptrue, %%% should we support this too?
%waving/.code = \ape@handposition@wavingtrue, %%% should we support this too?
hearnoevil/.code = \ape@handposition@hearnoeviltrue,
seenoevil/.code = \ape@handposition@seenoeviltrue,
speaknoevil/.code = \ape@handposition@speaknoeviltrue,
back/.code = \ape@backtrue,
openmouth/.code = \ape@openmouthtrue,
open mouth/.forward to = /ape/openmouth,
contour/.code = \ape@contourtrue
\def\ape@contour{#1}
\def\ape@mouth{#1},
contour/.default = black,
outline/.forward to = /ape/contour,
}
\def\ape@draw{%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% minimal bounding box size
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\path (-1.435,0.1) rectangle (1.435, 2.27);
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% store the current scale factor
% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}%
\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}%
\pgfmathsetmacro{\xscalefactor}{\tmpscaleA}
\pgfmathsetmacro{\yscalefactor}{\tmpscaleD}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% switch between 2D, 3D and contours, from
% https://chat.stackexchange.com/transcript/message/45991801#45991801
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifape@threeD
\def\ape@part@draw[##1]{\shade[ball color=##1]}
\else% 3D
\ifape@contour
\def\ape@part@draw[##1]{\draw[##1,\ape@contour,fill=white,line width=\scalingfactor*0.4pt]}
\else% contour
\def\ape@part@draw[##1]{\fill[##1]}
\fi% contour
\fi% 3D
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Body parts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\UseHook{tikzlings/ape/background}
\UseHook{tikzlings/background}
\csname apehookbackground\endcsname
\csname tikzlinghookbackground\endcsname
%
% Draw backside partially in reversed order %%%%%%%%%%%%%%%%%%%%%%%%
\ifape@back
% arms / hand for hear-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%
\ifape@handposition@hearnoevil%
\ape@part@draw[\ape@skin!90!white] (-0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=80];
\ape@part@draw[\ape@arms] (-0.55,1.73) {[rotate=-20] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (-0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=-125];
\ape@part@draw[\ape@skin!90!white] (0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=100];
\ape@part@draw[\ape@arms] (0.55,1.73) {[rotate=20] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=125];
% see-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@seenoevil%
\ape@part@draw[\ape@skin!90!white] (-0.325,1.91) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (-0.59,1.97) arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15] --cycle;
\ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
\ape@part@draw[\ape@skin!90!white] (0.325,1.91) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.59,1.97) arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15] --cycle;
\ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=110];
% speak-no-evil pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@speaknoevil%
\ape@part@draw[\ape@arms] (-0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=-100];
\ape@part@draw[\ape@skin!90!white] (-0.275,1.46) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (-0.53,1.52) {[rotate=-10] arc [start angle=15, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=100];
\ape@part@draw[\ape@skin!90!white] (0.275,1.46) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.53,1.52) {[rotate=10] arc [start angle=165, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
% clapping hand pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@clap%
\ape@part@draw[\ape@skin!90!white] (-0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=80];
\ape@part@draw[\ape@arms] (-0.23,2.65) {[rotate=10] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (-0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=30];
\ape@part@draw[\ape@skin!90!white] (0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=100];
\ape@part@draw[\ape@arms] (0.23,2.65) {[rotate=-10] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=150];
% waving left hand pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@waving%
\ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
\ape@part@draw[\ape@skin!90!white] (0.97,3.2) ++(390:0.3 and 0.1) {[rotate=90] arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle};
\ape@part@draw[\ape@arms] (1.35,2.74) {[rotate=100] arc [start angle=335, end angle=25,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=-70];
% default pose backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else
\ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
\ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
\fi\fi\fi\fi\fi
%
% legs / feet backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@skin] (1.2,0.27) ++(210:0.3 and 0.1) {[rotate=180] arc [start angle=210, end angle=-30,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=-30, end angle=-240,x radius=0.15, y radius=0.03]}-- cycle};
\ape@part@draw[\ape@legs] (0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=-30];
\ape@part@draw[\ape@legs] (0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=-45];
\ape@part@draw[\ape@skin] (-1.2,0.27) ++(-30:0.3 and 0.1) {[rotate=180] arc [start angle=-30, end angle=210,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=210, end angle=420,x radius=0.15, y radius=0.03]}-- cycle};
\ape@part@draw[\ape@legs] (-0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=30];
\ape@part@draw[\ape@legs] (-0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=45];
%
% head backside %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@body] (0, 1.76) circle[x radius=0.4,y radius=0.5];
\fi% back
%
% Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@body] ( 0.5, 0.8 ) .. controls ( 0.5 , 0.4) and ( 0.35, 0.17) .. ( 0.0, 0.17) .. controls (-0.35, 0.17) and (-0.5 , 0.4) .. (-0.5, 0.8 ) .. controls (-0.9 , 1.6) and (-0.4, 1.65) .. ( 0.0, 1.65) .. controls ( 0.4, 1.65) and ( 0.9 , 1.6) .. ( 0.5, 0.8) -- cycle;
%
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\UseHook{tikzlings/ape/belly}
\UseHook{tikzlings/belly}
\csname apehookbelly\endcsname
\csname tikzlinghookbelly\endcsname
%
% Show details only from the front %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\unless\ifape@back
% Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@body] (0, 1.76) circle[x radius=0.4,y radius=0.5];
\ape@part@draw[\ape@skin] (0, 1.76) circle[x radius=0.32,y radius=0.40];
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@eyes] (-0.08, 1.9) ellipse[x radius=0.04, y radius=0.04];
\ape@part@draw[\ape@eyes] (0.08, 1.9) ellipse[x radius=0.04, y radius=0.04];
%
% muzzle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@muzzle] (0, 1.55) ellipse[x radius=0.28, y radius=0.2];
%
% mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifape@openmouth
\ifape@threeD
\fill[\ape@mouth] (0,1.5) ellipse[x radius=0.05,y radius=0.07];
\else
\ape@part@draw[\ape@mouth] (0,1.5) ellipse[x radius=0.05,y radius=0.07];
\fi
\else
\draw[\ape@mouth,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ;
\fi
%
% Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifape@threeD
\fill[\ape@nose] (-0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=30 ];
\fill[\ape@nose] (0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=-30 ];
\else
\ape@part@draw[\ape@nose] (-0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=30 ];
\ape@part@draw[\ape@nose] (0.03, 1.63) ellipse[x radius=0.025, y radius=0.035, rotate=-30 ];
\fi
%
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@skin] (0.675,0.2) ++(-30:0.3 and 0.1) arc [start angle=-30, end angle=210,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=210, end angle=420,x radius=0.15, y radius=0.03]}-- cycle;
\ape@part@draw[\ape@skin] (-0.675,0.2) ++(210:0.3 and 0.1) arc [start angle=210, end angle=-30,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=-30, end angle=-240,x radius=0.15, y radius=0.03]}-- cycle;
%
% Legs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ape@part@draw[\ape@legs] (0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=-45];
\ape@part@draw[\ape@legs] (0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=-30];
\ape@part@draw[\ape@legs] (-0.52,0.68) ellipse[x radius=0.15, y radius=0.7, rotate=45];
\ape@part@draw[\ape@legs] (-0.7,0.67) ellipse[x radius=0.15, y radius=0.6, rotate=30];
%
% hear-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifape@handposition@hearnoevil
\ape@part@draw[\ape@arms] (-0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=-125];
\ape@part@draw[\ape@skin!90!white] (-0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=80];
\ape@part@draw[\ape@arms] (-0.55,1.73) {[rotate=-20] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.9,1.61) ellipse[x radius=0.15, y radius=0.6, rotate=125];
\ape@part@draw[\ape@skin!90!white] (0.45,1.9) ellipse [x radius=0.3, y radius=0.1,rotate=100];
\ape@part@draw[\ape@arms] (0.55,1.73) {[rotate=20] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
% see-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@seenoevil
\ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
\ape@part@draw[\ape@skin!90!white] (-0.325,1.91) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (-0.59,1.97) arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15] --cycle;
\ape@part@draw[\ape@arms] (0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=110];
\ape@part@draw[\ape@skin!90!white] (0.325,1.91) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.59,1.97) arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15] --cycle;
% speak-no-evil pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@speaknoevil%
\ape@part@draw[\ape@arms] (-0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=-100];
\ape@part@draw[\ape@skin!90!white] (-0.275,1.46) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (-0.53,1.52) {[rotate=-10] arc [start angle=15, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.85,1.55) ellipse[x radius=0.15, y radius=0.6, rotate=100];
\ape@part@draw[\ape@skin!90!white] (0.275,1.46) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.53,1.52) {[rotate=10] arc [start angle=165, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
% clapping pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@clap%
\ape@part@draw[\ape@arms] (-0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=30];
\ape@part@draw[\ape@skin!90!white] (-0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=80];
\ape@part@draw[\ape@arms] (-0.23,2.65) {[rotate=10] arc [start angle=35, end angle=350,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.75,1.95) ellipse[x radius=0.15, y radius=0.6, rotate=150];
\ape@part@draw[\ape@skin!90!white] (0.115,2.85) ellipse [x radius=0.3, y radius=0.1,rotate=100];
\ape@part@draw[\ape@arms] (0.23,2.65) {[rotate=-10] arc [start angle=145, end angle=-170,x radius=0.475, y radius=0.15]} --cycle;
% waving hand pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else\ifape@handposition@waving%
\ape@part@draw[\ape@arms] (-0.93,1.70) ellipse[x radius=0.15, y radius=0.6, rotate=70];
\ape@part@draw[\ape@skin!90!white] (-0.97,3.2) ++(150:0.3 and 0.1) {[rotate=-90] arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle};
\ape@part@draw[\ape@arms] (-1.35,2.74) {[rotate=80] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
\ape@part@draw[\ape@skin!90!white] (0.325,1.05) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
% normal pose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\else
\ape@part@draw[\ape@arms] (-0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=-60];
\ape@part@draw[\ape@skin!90!white] (-0.325,1.05) ++(390:0.3 and 0.1) arc [start angle=390, end angle=150,x radius=0.3, y radius=0.1] {[rotate=10] arc [start angle=150, end angle=-60,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (-0.53,1.115) {[rotate=5] arc [start angle=25, end angle=335,x radius=0.475, y radius=0.15]} --cycle;
\ape@part@draw[\ape@arms] (0.9,1.25) ellipse[x radius=0.15, y radius=0.6, rotate=60];
\ape@part@draw[\ape@skin!90!white] (0.325,1.05) ++(150:0.3 and 0.1) arc [start angle=150, end angle=390,x radius=0.3, y radius=0.1] {[rotate=-10] arc [start angle=30, end angle=240,x radius=0.15, y radius=0.03] } -- cycle;
\ape@part@draw[\ape@arms] (0.53,1.115) {[rotate=-5] arc [start angle=155, end angle=-155,x radius=0.475, y radius=0.15]} --cycle;
\fi\fi\fi\fi\fi%
\fi%
%
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\UseHook{tikzlings/ape/body}
\UseHook{tikzlings/body}
\csname apehookbody\endcsname
\csname tikzlinghookbody\endcsname
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Documentation
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\clearpage
%\section[Ape]{Sandra, the orangutan}
%
%\emph{The ape was kindly contributed by @NuzzleTOO. It is named after an orangutan who was freed from living alone in a zoo in Bueonos Aires and taken to a sanctuary for great apes after temporarily becoming legally a non-human person.}
%
%\subsection{Package name}
%
%\begin{tcolorbox}[title={Package usage}]
%\begin{samcode}
%\usepackage{tikzlings-apes}
%\end{samcode}
%\end{tcolorbox}
%
%\subsection{Basic Usage}
%
%\begin{tcblisting}{title={Basic ape}}
%\ape
%\end{tcblisting}
%
%\subsection{Options}
%
%The basic ape can be modified by changing its colour:
%\begin{tcblisting}{title={Body colour}}
%\ape[body=blue]
%\end{tcblisting}
%
%In addition to the colour of the body, the colour of various body parts can be adjusted:
%\begin{tcblisting}{title={Eye colour}}
%\ape[eyes=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Nose colour}}
%\ape[nose=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Mouth colour}}
%\ape[mouth=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Muzzle colour}}
%\ape[muzzle=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Skin colour}}
%\ape[skin=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Arm colour}}
%\ape[arms=red]
%\end{tcblisting}
%\begin{tcblisting}{title={Leg colour}}
%\ape[legs=red]
%\end{tcblisting}
%
%The ape make can make use of it hands in different ways:
%\begin{tcblisting}{title={Clapping ape}}
%\ape[handposition=clap]
%\end{tcblisting}
%\begin{tcblisting}{title={Waving ape}}
%\ape[handposition=waving]
%\end{tcblisting}
%
%Including the gestures of the three mystic apes \textbf{Mizaru} (see no evil), \textbf{Kikazaru} (hear no evil) and \textbf{Iwazaru} (speak no evil):
%\begin{tcblisting}{title={See no evil}}
%\ape[handposition=seenoevil]
%\end{tcblisting}
%\begin{tcblisting}{title={hear no evil}}
%\ape[handposition=hearnoevil]
%\end{tcblisting}
%\begin{tcblisting}{title={speak no evil}}
%\ape[handposition=speaknoevil]
%\end{tcblisting}
% As shortcuts, these three apes are also available via
%\saminline|\ape[seenoevil]|, \saminline|\ape[hearnoevil]|, \saminline|\ape[speaknoevil]| and \saminline|\ape[mizaru]|, \saminline|\ape[kikazaru]|, \saminline|\ape[iwazaru]|.
%
%To see a hooting ape:
%\begin{tcblisting}{title={Hooting ape}}
%\ape[openmouth]
%\end{tcblisting}
%
%To view the ape from behind:
%\begin{tcblisting}{title={Back view}}
%\ape[back]
%\end{tcblisting}
%
%The key \saminline|3D| will make the ape 3-dimensional:
%\begin{tcblisting}{title={3D view}}
%\ape[3D]
%\end{tcblisting}
%
%And finally the \saminline|contour| key will only draw the outlines:
%\begin{tcblisting}{title={Contours}}
%\ape[contour=black]
%\end{tcblisting}