| 1 |
% !TeX root = ./examples/chicken.tex |
| 2 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 |
%% |
| 4 |
%% This package is part of the TikZlings package |
| 5 |
%% A package to bring cute little animals and other beings into tikz |
| 6 |
%% Maintained by samcarter |
| 7 |
%% |
| 8 |
%% Project repository and bug tracker: |
| 9 |
%% https://github.com/samcarter/tikzlings |
| 10 |
%% |
| 11 |
%% Released under the LaTeX Project Public License v1.3c or later |
| 12 |
%% See https://www.latex-project.org/lppl.txt |
| 13 |
%% |
| 14 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 15 |
\ProvidesPackage{tikzlings-chickens}[2025/12/11 version v2.5 Draw chickens in TikZ] |
| 16 |
|
| 17 |
\RequirePackage{tikz} |
| 18 |
\RequirePackage{tikzlings-addons} |
| 19 |
\usetikzlibrary{decorations.pathmorphing} |
| 20 |
\usetikzlibrary{fpu} |
| 21 |
|
| 22 |
\newcommand*{\chicken}[1][]{% |
| 23 |
\begin{scope}% |
| 24 |
\tikzset{/chicken/.cd,#1}% |
| 25 |
\ifchicken@baby |
| 26 |
\chicken@drawbaby |
| 27 |
\else |
| 28 |
\chicken@draw% |
| 29 |
\fi |
| 30 |
\end{scope}% |
| 31 |
\thing[#1]% |
| 32 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 33 |
\UseHook{tikzlings/chicken/foreground} |
| 34 |
\UseHook{tikzlings/foreground} |
| 35 |
\csname chickenhookforeground\endcsname |
| 36 |
\csname tikzlinghookforeground\endcsname |
| 37 |
% |
| 38 |
} |
| 39 |
|
| 40 |
\newif\ifchicken@threeD |
| 41 |
\newif\ifchicken@back |
| 42 |
\newif\ifchicken@contour |
| 43 |
\newif\ifchicken@baby |
| 44 |
|
| 45 |
\NewHook{tikzlings/chicken/background} |
| 46 |
\NewHook{tikzlings/chicken/belly} |
| 47 |
\NewHook{tikzlings/chicken/body} |
| 48 |
\NewHook{tikzlings/chicken/foreground} |
| 49 |
|
| 50 |
\tikzset{ |
| 51 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 52 |
% |
| 53 |
% Pass unknown keys on to tikz |
| 54 |
% |
| 55 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 56 |
/chicken/.search also={/tikz,/pgf,/thing}, |
| 57 |
/chicken/.cd, |
| 58 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 59 |
% |
| 60 |
% body |
| 61 |
% |
| 62 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 63 |
body/.store in = \chicken@body, |
| 64 |
body = brown!90!orange!70!yellow!40!white, |
| 65 |
eyes/.store in = \chicken@eyes, |
| 66 |
eyes = white!90!gray, |
| 67 |
eye/.forward to = /chicken/eyes, |
| 68 |
pupils/.store in = \chicken@pupils, |
| 69 |
pupils = brown!30!black, |
| 70 |
pupil/.forward to = /chicken/pupils, |
| 71 |
bill/.store in = \chicken@bill, |
| 72 |
bill = yellow, |
| 73 |
feet/.store in = \chicken@feet, |
| 74 |
feet = orange!90!yellow, |
| 75 |
foot/.forward to = /chicken/feet, |
| 76 |
comb/.store in = \chicken@comb, |
| 77 |
comb = red, |
| 78 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 79 |
% |
| 80 |
% options |
| 81 |
% |
| 82 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 83 |
3D/.code = \chicken@threeDtrue, |
| 84 |
back/.code = \chicken@backtrue, |
| 85 |
contour/.code = \chicken@contourtrue |
| 86 |
\def\chicken@contour{#1}, |
| 87 |
contour/.default = black, |
| 88 |
outline/.forward to = /chicken/contour, |
| 89 |
baby/.code = \chicken@babytrue |
| 90 |
\def\chicken@baby{#1} |
| 91 |
\def\chicken@bill{\chicken@feet}, |
| 92 |
baby/.default = yellow!80!orange, |
| 93 |
} |
| 94 |
|
| 95 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 96 |
%% |
| 97 |
%% Grown up chicken |
| 98 |
%% |
| 99 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 100 |
\def\chicken@draw{% |
| 101 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 102 |
% |
| 103 |
% minimal bounding box size |
| 104 |
% |
| 105 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 106 |
\path (-0.96, 0.08) rectangle (0.96, 2.35); |
| 107 |
% |
| 108 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 109 |
% |
| 110 |
% store the current scale factor |
| 111 |
% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494 |
| 112 |
% |
| 113 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 114 |
\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}% |
| 115 |
\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}% |
| 116 |
\pgfmathsetmacro{\xscalefactor}{\tmpscaleA} |
| 117 |
\pgfmathsetmacro{\yscalefactor}{\tmpscaleD} |
| 118 |
% |
| 119 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 120 |
% |
| 121 |
% switch between 2D, 3D and contours, from |
| 122 |
% https://chat.stackexchange.com/transcript/message/45991801#45991801 |
| 123 |
% |
| 124 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 125 |
\ifchicken@threeD |
| 126 |
\def\chicken@part@draw[##1]{\shade[ball color=##1]} |
| 127 |
\else% 3D |
| 128 |
\ifchicken@contour |
| 129 |
\def\chicken@part@draw[##1]{\draw[##1,\chicken@contour,fill=white,line width=\scalingfactor*0.4pt]} |
| 130 |
\else% contour |
| 131 |
\def\chicken@part@draw[##1]{\fill[##1]} |
| 132 |
\fi% contour |
| 133 |
\fi% 3D |
| 134 |
% |
| 135 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 136 |
% |
| 137 |
% generating saturated version of body colour |
| 138 |
% |
| 139 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 140 |
\extractcolorspecs{\chicken@body}{\chicken@model}{\chicken@colorspec} |
| 141 |
\convertcolorspec{\chicken@model}{\chicken@colorspec}{hsb}{\chicken@hsbcolorspec} |
| 142 |
\pgfmathsetmacro{\chicken@hue}{(array({\chicken@hsbcolorspec},0))} |
| 143 |
\pgfmathsetmacro{\chicken@sat}{(array({\chicken@hsbcolorspec},1)+0.5)} |
| 144 |
\pgfmathsetmacro{\chicken@bright}{(array({\chicken@hsbcolorspec},2))} |
| 145 |
\definecolor{chicken@bodysat50}{hsb}{\chicken@hue,\chicken@sat,\chicken@bright} |
| 146 |
% |
| 147 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 148 |
% |
| 149 |
% Body parts |
| 150 |
% |
| 151 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 152 |
% |
| 153 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 154 |
\UseHook{tikzlings/chicken/background} |
| 155 |
\UseHook{tikzlings/background} |
| 156 |
\csname chickenhookbackground\endcsname |
| 157 |
\csname tikzlinghookbackground\endcsname |
| 158 |
% |
| 159 |
% Wings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 160 |
\chicken@part@draw[chicken@bodysat50] (0.57,0.95) ellipse[x radius=0.3, y radius=0.08, rotate=-65]; |
| 161 |
\chicken@part@draw[chicken@bodysat50] (0.64,1.07) ellipse[x radius=0.3, y radius=0.08, rotate=-43]; |
| 162 |
\chicken@part@draw[chicken@bodysat50] (0.66,1.18) ellipse[x radius=0.3, y radius=0.08, rotate=-18]; |
| 163 |
\chicken@part@draw[chicken@bodysat50] (-0.57,0.95) ellipse[x radius=0.3, y radius=0.08, rotate=65]; |
| 164 |
\chicken@part@draw[chicken@bodysat50] (-0.64,1.07) ellipse[x radius=0.3, y radius=0.08, rotate=43]; |
| 165 |
\chicken@part@draw[chicken@bodysat50] (-0.66,1.18) ellipse[x radius=0.3, y radius=0.08, rotate=18]; |
| 166 |
% |
| 167 |
% Feet if back %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 168 |
\ifchicken@back |
| 169 |
\chicken@part@draw[\chicken@feet] (0.19,0.3) ellipse[x radius=0.03, y radius=0.1]; |
| 170 |
\chicken@part@draw[\chicken@feet] (-0.19,0.3) ellipse[x radius=0.03, y radius=0.1]; |
| 171 |
\chicken@part@draw[\chicken@feet] (0.175,0.2) ellipse[x radius=0.03, y radius=0.1]; |
| 172 |
\chicken@part@draw[\chicken@feet] (0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=20]; |
| 173 |
\chicken@part@draw[\chicken@feet] (0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=40]; |
| 174 |
\chicken@part@draw[\chicken@feet] (-0.175,0.2) ellipse[x radius=0.03, y radius=0.1]; |
| 175 |
\chicken@part@draw[\chicken@feet] (-0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=-20]; |
| 176 |
\chicken@part@draw[\chicken@feet] (-0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=-40]; |
| 177 |
\fi% back |
| 178 |
% |
| 179 |
% Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 180 |
\chicken@part@draw[\chicken@body] ( 0.00, 0.33) .. controls (-0.60, 0.33) and (-0.55, 0.65) .. (-0.55, 0.90) .. controls (-0.55, 1.10) and (-0.48, 1.20) .. (-0.39, 1.40) .. controls (-0.32, 1.58) and (-0.32, 2.09) .. ( 0.00, 2.09) .. controls ( 0.32, 2.09) and ( 0.32, 1.58) .. ( 0.39, 1.40) .. controls ( 0.48, 1.20) and ( 0.55, 1.10) .. ( 0.55, 0.90) .. controls ( 0.55, 0.65) and ( 0.60, 0.33) .. ( 0, 0.33) -- cycle; |
| 181 |
\chicken@part@draw[chicken@bodysat50,decoration={snake,amplitude=\scalingfactor*1.5pt,segment length=\scalingfactor*6.1pt},/pgf/fpu/install only={reciprocal}] ( -0.39, 1.40) .. controls (-0.32, 1.58) and (-0.32, 2.09) .. ( 0.00, 2.09) .. controls ( 0.32, 2.09) and ( 0.32, 1.58) .. ( 0.39, 1.40) decorate {arc [start angle=-60,end angle=-120,radius=0.77]} -- cycle; |
| 182 |
% |
| 183 |
% Comb %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 184 |
\chicken@part@draw[\chicken@comb] (0.04,2.132) ellipse[x radius=0.22, y radius=0.06, rotate=70]; |
| 185 |
\chicken@part@draw[\chicken@comb] (-0.03,2.095) ellipse[x radius=0.17, y radius=0.06, rotate=92]; |
| 186 |
\chicken@part@draw[\chicken@comb] (-0.082,2.060) ellipse[x radius=0.15, y radius=0.06, rotate=120]; |
| 187 |
% |
| 188 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 189 |
\UseHook{tikzlings/chicken/belly} |
| 190 |
\UseHook{tikzlings/belly} |
| 191 |
\csname chickenhookbelly\endcsname |
| 192 |
\csname tikzlinghookbelly\endcsname |
| 193 |
% |
| 194 |
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 195 |
\unless\ifchicken@back |
| 196 |
\chicken@part@draw[\chicken@eyes] (0.135,1.8) ellipse[x radius=0.06, y radius=0.07]; |
| 197 |
\chicken@part@draw[\chicken@eyes] (-0.135,1.8) ellipse[x radius=0.06, y radius=0.07]; |
| 198 |
\chicken@part@draw[\chicken@pupils] (0.124,1.78) ellipse[x radius=0.017, y radius=0.027]; |
| 199 |
\chicken@part@draw[\chicken@pupils] (-0.124,1.78) ellipse[x radius=0.017, y radius=0.027]; |
| 200 |
\fi% back |
| 201 |
% |
| 202 |
% Bill %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 203 |
\unless\ifchicken@back |
| 204 |
\chicken@part@draw[\chicken@comb] (-0.04, 1.57) ellipse[x radius=0.04, y radius=0.08, rotate=-20]; |
| 205 |
\chicken@part@draw[\chicken@comb] (0.04, 1.57) ellipse[x radius=0.04, y radius=0.08, rotate=20]; |
| 206 |
\chicken@part@draw[\chicken@bill] (-0.09, 1.7) -- (0, 1.58) -- (0.09, 1.7) arc [start angle=50, end angle=130, radius=0.14] -- cycle; |
| 207 |
\fi% back |
| 208 |
% |
| 209 |
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 210 |
\unless\ifchicken@back |
| 211 |
\chicken@part@draw[\chicken@feet] (0.19,0.3) ellipse[x radius=0.03, y radius=0.1]; |
| 212 |
\chicken@part@draw[\chicken@feet] (-0.19,0.3) ellipse[x radius=0.03, y radius=0.1]; |
| 213 |
\chicken@part@draw[\chicken@feet] (0.175,0.2) ellipse[x radius=0.03, y radius=0.1]; |
| 214 |
\chicken@part@draw[\chicken@feet] (0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=20]; |
| 215 |
\chicken@part@draw[\chicken@feet] (0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=40]; |
| 216 |
\chicken@part@draw[\chicken@feet] (-0.175,0.2) ellipse[x radius=0.03, y radius=0.1]; |
| 217 |
\chicken@part@draw[\chicken@feet] (-0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=-20]; |
| 218 |
\chicken@part@draw[\chicken@feet] (-0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=-40]; |
| 219 |
\fi% back |
| 220 |
% |
| 221 |
% Tail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 222 |
\ifchicken@back |
| 223 |
\chicken@part@draw[chicken@bodysat50] (0.12, 0.795) ellipse[x radius=0.20, y radius=0.06, rotate=58]; |
| 224 |
\chicken@part@draw[chicken@bodysat50] (0.04, 0.87) ellipse[x radius=0.25, y radius=0.06, rotate=80]; |
| 225 |
\chicken@part@draw[chicken@bodysat50] (-0.03, 0.83) ellipse[x radius=0.20, y radius=0.06, rotate=102]; |
| 226 |
\chicken@part@draw[chicken@bodysat50] (-0.082, 0.76) ellipse[x radius=0.17, y radius=0.06, rotate=130]; |
| 227 |
\fi% back |
| 228 |
% |
| 229 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 230 |
\UseHook{tikzlings/chicken/body} |
| 231 |
\UseHook{tikzlings/body} |
| 232 |
\csname chickenhookbody\endcsname |
| 233 |
\csname tikzlinghookbody\endcsname |
| 234 |
% |
| 235 |
} |
| 236 |
|
| 237 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 238 |
%% |
| 239 |
%% Baby chicken |
| 240 |
%% |
| 241 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 242 |
\def\chicken@drawbaby{% |
| 243 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 244 |
% |
| 245 |
% minimal bounding box size |
| 246 |
% |
| 247 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 248 |
\path (-0.53, 0.1) rectangle (0.53, 1.22); |
| 249 |
% |
| 250 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 251 |
% |
| 252 |
% store the current scale factor |
| 253 |
% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494 |
| 254 |
% |
| 255 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 256 |
\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}% |
| 257 |
\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))*sqrt(abs((\pgf@xx/1cm)*(\pgf@yy/1cm)-(\pgf@xy/1cm)*(\pgf@yx/1cm)))}% |
| 258 |
\pgfmathsetmacro{\xscalefactor}{\tmpscaleA} |
| 259 |
\pgfmathsetmacro{\yscalefactor}{\tmpscaleD} |
| 260 |
% |
| 261 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 262 |
% |
| 263 |
% switch between 2D, 3D and contours, from |
| 264 |
% https://chat.stackexchange.com/transcript/message/45991801#45991801 |
| 265 |
% |
| 266 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 267 |
\ifchicken@threeD |
| 268 |
\def\chicken@part@draw[##1]{\shade[ball color=##1]} |
| 269 |
\else% 3D |
| 270 |
\ifchicken@contour |
| 271 |
\def\chicken@part@draw[##1]{\draw[##1,\chicken@contour,fill=white,line width=\scalingfactor*0.4pt]} |
| 272 |
\else% contour |
| 273 |
\def\chicken@part@draw[##1]{\fill[##1]} |
| 274 |
\fi% contour |
| 275 |
\fi% 3D |
| 276 |
% |
| 277 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 278 |
% |
| 279 |
% Body parts (center: x=0.925) |
| 280 |
% |
| 281 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 282 |
% |
| 283 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 284 |
\UseHook{tikzlings/chicken/background} |
| 285 |
\UseHook{tikzlings/background} |
| 286 |
\csname chickenhookbackground\endcsname |
| 287 |
\csname tikzlinghookbackground\endcsname |
| 288 |
% |
| 289 |
% Wings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 290 |
\begin{scope}[scale=0.55] |
| 291 |
\chicken@part@draw[\chicken@baby] (0.57,0.95) ellipse[x radius=0.3, y radius=0.08, rotate=-65]; |
| 292 |
\chicken@part@draw[\chicken@baby] (0.64,1.07) ellipse[x radius=0.3, y radius=0.08, rotate=-43]; |
| 293 |
\chicken@part@draw[\chicken@baby] (0.66,1.18) ellipse[x radius=0.3, y radius=0.08, rotate=-18]; |
| 294 |
\chicken@part@draw[\chicken@baby] (-0.57,0.95) ellipse[x radius=0.3, y radius=0.08, rotate=65]; |
| 295 |
\chicken@part@draw[\chicken@baby] (-0.64,1.07) ellipse[x radius=0.3, y radius=0.08, rotate=43]; |
| 296 |
\chicken@part@draw[\chicken@baby] (-0.66,1.18) ellipse[x radius=0.3, y radius=0.08, rotate=18]; |
| 297 |
\end{scope} |
| 298 |
% |
| 299 |
% Feet if back %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 300 |
\ifchicken@back |
| 301 |
\begin{scope}[scale=0.67] |
| 302 |
\chicken@part@draw[\chicken@feet] (0.19,0.38) ellipse[x radius=0.03, y radius=0.1]; |
| 303 |
\chicken@part@draw[\chicken@feet] (-0.19,0.38) ellipse[x radius=0.03, y radius=0.1]; |
| 304 |
\chicken@part@draw[\chicken@feet] (0.175,0.27) ellipse[x radius=0.03, y radius=0.1]; |
| 305 |
\chicken@part@draw[\chicken@feet] (0.225,0.28) ellipse[x radius=0.03, y radius=0.1, rotate=20]; |
| 306 |
\chicken@part@draw[\chicken@feet] (0.275,0.3) ellipse[x radius=0.03, y radius=0.1, rotate=40]; |
| 307 |
\chicken@part@draw[\chicken@feet] (-0.175,0.27) ellipse[x radius=0.03, y radius=0.1]; |
| 308 |
\chicken@part@draw[\chicken@feet] (-0.225,0.28) ellipse[x radius=0.03, y radius=0.1, rotate=-20]; |
| 309 |
\chicken@part@draw[\chicken@feet] (-0.275,0.3) ellipse[x radius=0.03, y radius=0.1, rotate=-40]; |
| 310 |
\end{scope} |
| 311 |
\fi% back |
| 312 |
% |
| 313 |
% Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 314 |
\chicken@part@draw[\chicken@baby] (0,0.55) circle [radius=0.3]; |
| 315 |
% |
| 316 |
% Comb %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 317 |
\begin{scope}[scale=0.52] |
| 318 |
\chicken@part@draw[\chicken@baby] (0.04,2.142) ellipse[x radius=0.2, y radius=0.05, rotate=70]; |
| 319 |
\chicken@part@draw[\chicken@baby] (-0.03,2.105) ellipse[x radius=0.15, y radius=0.05, rotate=92]; |
| 320 |
\chicken@part@draw[\chicken@baby] (-0.082,2.070) ellipse[x radius=0.13, y radius=0.05, rotate=120]; |
| 321 |
\end{scope} |
| 322 |
% |
| 323 |
% Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 324 |
\chicken@part@draw[\chicken@baby] (0,0.87) circle [radius=0.25]; |
| 325 |
% |
| 326 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 327 |
\UseHook{tikzlings/chicken/belly} |
| 328 |
\UseHook{tikzlings/belly} |
| 329 |
\csname chickenhookbelly\endcsname |
| 330 |
\csname tikzlinghookbelly\endcsname |
| 331 |
% |
| 332 |
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 333 |
\unless\ifchicken@back |
| 334 |
\chicken@part@draw[\chicken@eyes] (0.075,0.925) ellipse[x radius=0.055, y radius=0.065]; |
| 335 |
\chicken@part@draw[\chicken@eyes] (-0.075,0.925) ellipse[x radius=0.055, y radius=0.065]; |
| 336 |
\chicken@part@draw[\chicken@pupils] (0.07,0.91) ellipse[x radius=0.017, y radius=0.024]; |
| 337 |
\chicken@part@draw[\chicken@pupils] (-0.07,0.91) ellipse[x radius=0.017, y radius=0.024]; |
| 338 |
\fi% back |
| 339 |
% |
| 340 |
% Bill %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 341 |
\unless\ifchicken@back |
| 342 |
\chicken@part@draw[\chicken@bill] (-0.05, 0.81) -- (0, 0.74) -- (0.05, 0.81) arc [start angle=60, end angle=120, radius=0.1] -- cycle; |
| 343 |
\fi% back |
| 344 |
% |
| 345 |
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 346 |
\unless\ifchicken@back |
| 347 |
\begin{scope}[scale=0.67] |
| 348 |
\chicken@part@draw[\chicken@feet] (0.19,0.38) ellipse[x radius=0.03, y radius=0.1]; |
| 349 |
\chicken@part@draw[\chicken@feet] (-0.19,0.38) ellipse[x radius=0.03, y radius=0.1]; |
| 350 |
\chicken@part@draw[\chicken@feet] (0.175,0.27) ellipse[x radius=0.03, y radius=0.1]; |
| 351 |
\chicken@part@draw[\chicken@feet] (0.225,0.28) ellipse[x radius=0.03, y radius=0.1, rotate=20]; |
| 352 |
\chicken@part@draw[\chicken@feet] (0.275,0.3) ellipse[x radius=0.03, y radius=0.1, rotate=40]; |
| 353 |
\chicken@part@draw[\chicken@feet] (-0.175,0.27) ellipse[x radius=0.03, y radius=0.1]; |
| 354 |
\chicken@part@draw[\chicken@feet] (-0.225,0.28) ellipse[x radius=0.03, y radius=0.1, rotate=-20]; |
| 355 |
\chicken@part@draw[\chicken@feet] (-0.275,0.3) ellipse[x radius=0.03, y radius=0.1, rotate=-40]; |
| 356 |
\end{scope} |
| 357 |
\fi% back |
| 358 |
% |
| 359 |
% adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 360 |
\UseHook{tikzlings/chicken/body} |
| 361 |
\UseHook{tikzlings/body} |
| 362 |
\csname chickenhookbody\endcsname |
| 363 |
\csname tikzlinghookbody\endcsname |
| 364 |
% |
| 365 |
} |
| 366 |
|
| 367 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 368 |
%% |
| 369 |
%% Documentation |
| 370 |
%% |
| 371 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 372 |
%\clearpage |
| 373 |
%\section[Chicken]{Paulette, the chicken} |
| 374 |
% |
| 375 |
%\emph{Paulette is named after the French word for chicken ``poulet''} |
| 376 |
% |
| 377 |
%\subsection{Package name} |
| 378 |
% |
| 379 |
%\begin{tcolorbox}[title={Package usage}] |
| 380 |
%\begin{samcode} |
| 381 |
%\usepackage{tikzlings-chickens} |
| 382 |
%\end{samcode} |
| 383 |
%\end{tcolorbox} |
| 384 |
% |
| 385 |
%\subsection{Basic Usage} |
| 386 |
% |
| 387 |
%\begin{tcblisting}{title={Basic chicken}} |
| 388 |
%\chicken |
| 389 |
%\end{tcblisting} |
| 390 |
% |
| 391 |
%\subsection{Options} |
| 392 |
% |
| 393 |
%The basic chicken can be modified by changing its colour: |
| 394 |
%\begin{tcblisting}{title={Body colour}} |
| 395 |
%\chicken[body=blue] |
| 396 |
%\end{tcblisting} |
| 397 |
% |
| 398 |
%In addition to the colour of the body, the colour of various body parts can be adjusted: |
| 399 |
%\begin{tcblisting}{title={Comb colour}} |
| 400 |
%\chicken[comb=green] |
| 401 |
%\end{tcblisting} |
| 402 |
% |
| 403 |
%\begin{tcblisting}{title={Eye colour}} |
| 404 |
%\chicken[eyes=red] |
| 405 |
%\end{tcblisting} |
| 406 |
% |
| 407 |
%\begin{tcblisting}{title={Pupil color}} |
| 408 |
%\chicken[pupils=red] |
| 409 |
%\end{tcblisting} |
| 410 |
% |
| 411 |
%\begin{tcblisting}{title={Bill colour}} |
| 412 |
%\chicken[bill=red] |
| 413 |
%\end{tcblisting} |
| 414 |
% |
| 415 |
%\begin{tcblisting}{title={Foot colour}} |
| 416 |
%\chicken[feet=red] |
| 417 |
%\end{tcblisting} |
| 418 |
% |
| 419 |
%There is also the special option \saminline|baby| which will draw a baby chicken called \emph{Pio}: |
| 420 |
%\begin{tcblisting}{title={Baby chicken}} |
| 421 |
%\chicken[baby=yellow] |
| 422 |
%\end{tcblisting} |
| 423 |
% |
| 424 |
%To view the chicken from behind: |
| 425 |
%\begin{tcblisting}{title={Back view}} |
| 426 |
%\chicken[back] |
| 427 |
%\end{tcblisting} |
| 428 |
% |
| 429 |
%The key \saminline|3D| will make the chicken 3-dimensional: |
| 430 |
%\begin{tcblisting}{title={3D view}} |
| 431 |
%\chicken[3D] |
| 432 |
%\end{tcblisting} |
| 433 |
% |
| 434 |
%And finally the \saminline|contour| key will only draw the outlines: |
| 435 |
%\begin{tcblisting}{title={Contours}} |
| 436 |
%\chicken[contour=black] |
| 437 |
%\end{tcblisting} |