From 8df9c434780b2d6ba9b711f34b8213416cdabe6c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 4 Sep 2017 21:44:24 +0000 Subject: tikzducks (4sep17) git-svn-id: svn://tug.org/texlive/trunk@45211 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/tikzducks/tikzducks.sty | 403 +++++++++++++++++---- 1 file changed, 338 insertions(+), 65 deletions(-) (limited to 'Master/texmf-dist/tex/latex/tikzducks') diff --git a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty index d549ac66320..55f51b7cef1 100644 --- a/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty +++ b/Master/texmf-dist/tex/latex/tikzducks/tikzducks.sty @@ -10,8 +10,8 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.3 -% Aug 15, 2017 +% Version 0.4 +% Sep 04, 2017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -21,6 +21,7 @@ \RequirePackage{tikz} \usetikzlibrary{patterns} % for the wizard hat %\usetikzlibrary{intersections} % for named paths +\usetikzlibrary{calc} % for the sports jerseys \newcommand*{\duck}[1][]{\tikzset{% /duck/.cd,#1}\duck@draw% @@ -40,6 +41,8 @@ \newif\ifduck@tshirt \newif\ifduck@jacket \newif\ifduck@tie +\newif\ifduck@cape +\newif\ifduck@stripes % Accessories %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newif\ifduck@glasses \newif\ifduck@sunglasses @@ -53,6 +56,19 @@ \newif\ifduck@magichat \newif\ifduck@magicwand \newif\ifduck@cricket +\newif\ifduck@rollingpin +\newif\ifduck@chef +\newif\ifduck@signpost +\newif\ifduck@witch +\newif\ifduck@graduate +\newif\ifduck@lightsaber +\newif\ifduck@cake +\newif\ifduck@pizza +\newif\ifduck@hockey +\newif\ifduck@beret +\newif\ifduck@baguette +\newif\ifduck@crown +\newif\ifduck@football \tikzset{ /duck/.cd, @@ -85,13 +101,17 @@ % clothing % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - tshirt/.code = \duck@tshirttrue \def\duck@tshirt{#1}, - jacket/.code = \duck@jackettrue \def\duck@jacket{#1}, - tie/.code = \duck@tietrue \def\duck@tie{#1}, + tshirt/.code = \duck@tshirttrue \def\duck@tshirt{#1}, + jacket/.code = \duck@jackettrue \def\duck@jacket{#1}, + tie/.code = \duck@tietrue \def\duck@tie{#1}, + cape/.code = \duck@capetrue \def\duck@cape{#1}, + stripes/.code = \duck@stripestrue \def\duck@stripes{#1}, % setting default %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - tshirt/.default = white, - jacket/.default = blue, - tie/.default = blue, + tshirt/.default = white, + jacket/.default = blue, + tie/.default = blue, + cape/.default = red, + stripes/.default = \stripes , %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % hair styles @@ -119,6 +139,10 @@ hat/.code = \duck@hattrue \def\duck@hat{#1}, cap/.code = \duck@captrue \def\duck@cap{#1}, santa/.code = \duck@santatrue \def\duck@santa{#1}, + chef/.code = \duck@cheftrue \def\duck@chef{#1}, + graduate/.code = \duck@graduatetrue \def\duck@graduate{#1}, + tassel/.code = \def\duck@tassel{#1}, + beret/.code = \duck@berettrue \def\duck@beret{#1}, unicorn/.code = \duck@unicorntrue \def\duck@unicorn{#1}, icecream/.code = \duck@icecreamtrue \def\duck@cone{#1}, flavoura/.code = \def\duck@flavoura{#1}, @@ -126,10 +150,22 @@ flavourc/.code = \def\duck@flavourc{#1}, book/.code = \duck@booktrue \def\duck@book{#1}, bookcolour/.code = \def\duck@bookcolour{#1}, + signpost/.code = \duck@signposttrue \def\duck@signpost{#1}, + signcolour/.code = \def\duck@signcolour{#1}, + signback/.code = \def\duck@signback{#1}, magichat/.code = \duck@magichattrue \def\duck@magichat{#1}, magicstars/.code = \def\duck@magicstars{#1}, magicwand/.code = \duck@magicwandtrue, + witch/.code = \duck@witchtrue \def\duck@witch{#1}, cricket/.code = \duck@crickettrue \def\duck@cricket{#1}, + rollingpin/.code = \duck@rollingpintrue \def\duck@rollingpin{#1}, + lightsaber/.code = \duck@lightsabertrue \def\duck@lightsaber{#1}, + cake/.code = \duck@caketrue \def\duck@cake{#1}, + pizza/.code = \duck@pizzatrue, + hockey/.code = \duck@hockeytrue \def\duck@hockey{#1}, + baguette/.code = \duck@baguettetrue \def\duck@baguette{#1}, + crown/.code = \duck@crowntrue \def\duck@crown{#1}, + football/.code = \duck@footballtrue \def\duck@football{#1}, % setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% glasses/.default = black, sunglasses/.default = black, @@ -137,20 +173,41 @@ hat/.default = brown, cap/.default = blue, santa/.default = red!80!black, + chef/.default = gray!20!white, + graduate/.default = black, + tassel = red, + beret/.default = black, unicorn/.default = pink, - icecream/.default = brown!70!black, + icecream/.default = brown!60!gray, flavoura = brown!50!black, flavourb = white!70!brown, flavourc = red!50!white, bookcolour = brown, + signcolour = brown!50!black, + signback = green!40!black, magichat/.default = violet, magicstars = yellow!80!brown, + witch/.default = black, cricket/.default = brown, + rollingpin/.default = brown, + lightsaber/.default = green, + cake/.default = violet, + hockey/.default = brown, + baguette/.default = brown, + crown/.default = yellow, + football/.default = white, } \def\duck@draw{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% minimal bounding box size +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\path (0.1,0.1) rectangle (2.1,2.12); +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % defining some coordinates % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -166,14 +223,10 @@ % % water %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@water - \draw[\duck@water, line width=5] - (1.00,0.40) ellipse (0.80 and 0.28); - \draw[\duck@water, line width=3] - (1.00,0.40) ellipse (1.00 and 0.45); - \draw[\duck@water, line width=2] - (1.00,0.40) ellipse (1.20 and 0.60); - \draw[\duck@water, line width=1] - (1.00,0.40) ellipse (1.40 and 0.75); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (0.88 and 0.35) (1.00,0.40) ellipse (0.75 and 0.25); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.05 and 0.50) (1.00,0.40) ellipse (0.95 and 0.42); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.23 and 0.63) (1.00,0.40) ellipse (1.17 and 0.57); + \fill[\duck@water, even odd rule] (1.00,0.40) ellipse (1.42 and 0.77) (1.00,0.40) ellipse (1.38 and 0.73); \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -183,7 +236,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[\duck@body] \duckpathbody; +\begin{pgfinterruptboundingbox} + \fill[\duck@body] \duckpathbody; +\end{pgfinterruptboundingbox} % % head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifdefined\duck@head\else\let\duck@head=\duck@body\fi @@ -217,17 +272,33 @@ % % tshirt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@tshirt - \fill[\duck@tshirt] \duckpathtshirt; + \begin{pgfinterruptboundingbox} + \fill[\duck@tshirt] \duckpathtshirt; + \end{pgfinterruptboundingbox} \fi % % tie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@tie - \draw[line width=3,color=\duck@tie] (0.60,1.00) -- (0.50,0.60); + \fill[\duck@tie,rotate=-12] (0.32,0.7) rectangle (0.43,1.15); \fi % % jacket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@jacket - \fill[\duck@jacket] \duckpathjacket; + \begin{pgfinterruptboundingbox} + \fill[\duck@jacket] \duckpathjacket; + \end{pgfinterruptboundingbox} +\fi +% +% stripes for football jersey %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@stripes + \duck@stripes +\fi +% +% superhero cape %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@cape + \begin{pgfinterruptboundingbox} + \fill[\duck@cape] \duckpathcape; + \end{pgfinterruptboundingbox} \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -238,22 +309,34 @@ % % short hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@shorthair - \fill[\duck@hair] \duckpathshorthair; + \path (0.1,0.1) rectangle (2.1,2.25); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathshorthair; + \end{pgfinterruptboundingbox} \fi % % long hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@longhair - \fill[\duck@hair] \duckpathlonghair; + \path (0.1,0.1) rectangle (2.1,2.25); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathlonghair; + \end{pgfinterruptboundingbox} \fi % % crazy hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@crazyhair - \fill[\duck@hair] \duckpathcrazyhair; + \path (0.1,0.1) rectangle (2.1,2.4); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathcrazyhair; + \end{pgfinterruptboundingbox} \fi % % receding hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@recedinghair - \fill[\duck@hair] \duckpathrecedinghair; + \path (0.1,0.1) rectangle (2.1,2.18); + \begin{pgfinterruptboundingbox} + \fill[\duck@hair] \duckpathrecedinghair; + \end{pgfinterruptboundingbox} \fi % % eye brow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -262,10 +345,8 @@ \ifdefined\duck@hair\let\duck@eyebrow=\duck@hair\fi \fi% \ifduck@eyebrow - \draw[line width=2,color=\duck@eyebrow,line cap=round] - (0.96,1.70) -- (0.82,1.77); - \draw[line width=2,color=\duck@eyebrow,line cap=round] - (0.50,1.81) -- (0.60,1.82); + \fill[\duck@eyebrow, rounded corners=1, rotate=60] (1.92,0.21) rectangle (1.98,-0.01); + \fill[\duck@eyebrow, rounded corners=1, rotate=100] (1.67,-0.77) rectangle (1.73,-0.95); \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -276,41 +357,33 @@ % % sunglasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@sunglasses - \draw[\duck@sunglasses,line width=1] - (0.93,1.62) -- (1.30,1.50); - \draw[line width=1,color=\duck@sunglasses] - (0.73,1.67) arc (65:92:0.20); - \fill[\duck@sunglasses, line width=1,rotate=-20] - (0.23,1.7675) circle (0.125); - \fill[\duck@sunglasses,line width=1,rotate=-20] - (-0.06,1.74) circle (0.1143); + \fill[\duck@sunglasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84); + \fill[\duck@sunglasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84); + \fill[\duck@sunglasses,rotate=-20] (0.23,1.7675) circle (0.14); + \fill[\duck@sunglasses,rotate=-20] (-0.06,1.74) circle (0.13); \fi % % glasses %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@glasses - \draw[\duck@glasses,line width=1] - (0.93,1.62) -- (1.30,1.50); - \draw[line width=1,color=\duck@glasses] - (0.73,1.67) arc (65:92:0.20); - \draw[\duck@glasses, line width=1,rotate=-20] - (0.23,1.7675) circle (0.125); - \draw[\duck@glasses,line width=1,rotate=-20] - (-0.06,1.74) circle (0.1143); + \fill[\duck@glasses,rotate=-17] (0.42,1.8) rectangle (0.8,1.84); + \fill[\duck@glasses,rotate=-17] (0.12,1.8) rectangle (0.22,1.84); + \fill[\duck@glasses,rotate=-20,even odd rule] (0.23,1.7675) circle (0.14) (0.23,1.7675) circle (0.11); + \fill[\duck@glasses,rotate=-20,even odd rule] (-0.06,1.74) circle (0.13) (-0.06,1.74) circle (0.095); \fi % % alien %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@alien - \draw[line width=2,color=\duck@alien] (1.00,1.83) -- (1.20,2.30); - \draw[line width=2,color=\duck@alien] (0.65,1.92) -- (0.60,2.35); + \fill[\duck@alien,rotate=-25] (0.09,2.1) rectangle (0.16,2.6); + \fill[\duck@alien,rotate=5] (0.79,1.86) rectangle (0.86,2.25); \fill[\duck@alien] (1.20,2.30) circle (0.07); - \fill[\duck@alien] (0.60,2.35) circle (0.07); + \fill[\duck@alien] (0.62,2.35) circle (0.07); \fi % % hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@hat - \fill[\duck@hat] (0.90,1.95) ellipse (0.46 and 0.0893); - \fill[\duck@hat] (0.90,2.20) ellipse (0.25 and 0.0714); - \fill[\duck@hat] (1.15,2.20) rectangle (0.65,1.95); + \fill[\duck@hat,rotate=-15] (0.44,2.1) ellipse (0.6 and 0.1); + \fill[\duck@hat,rotate=-15] (0.07,2.1) rectangle (0.81,2.4); + \fill[\duck@hat,rotate=-15] (0.44,2.4) ellipse (0.37 and 0.08); \fi % % cap %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -335,23 +408,44 @@ \fill[white!80!brown] (1.6,1.0) circle (0.17); \fi % +% Chef hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@chef + \fill[\duck@chef,rotate=-15] (0.44,2.1) ellipse (0.37 and 0.08); + \fill[\duck@chef,rotate=-15] (0.07,2.1) rectangle (0.81,2.55); + \fill[\duck@chef] (1.01,2.47) circle (0.17); + \fill[\duck@chef] (1.24,2.35) circle (0.15); + \fill[\duck@chef] (0.77,2.40) circle (0.12); + \fill[\duck@chef] (1.39,2.20) circle (0.12); +\fi +% +% graduate hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@graduate + \fill[\duck@graduate,rotate=-15] (0.44,2.1) ellipse (0.37 and 0.1); + \fill[\duck@graduate,rotate=-15] (0.07,2.1) rectangle (0.81,2.3); + \fill[\duck@graduate] (0.3,2.25) -- (1.05,2.35) -- (1.7,1.95) -- (0.92,1.85) -- cycle; + \fill[\duck@tassel,rounded corners=1] (1.12,1.89) -- (1.01,2.1) -- (1.09,2.11) -- (1.2,1.9) -- (1.2,1.3) -- (1.12,1.3) -- cycle; + \fill[\duck@tassel] (1.16,1.3) ellipse (0.06 and 0.12); +\fi +% +% beret %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@beret + \fill[\duck@beret,rotate=-25] (0.13,2.15) ellipse (0.5 and 0.17); + \fill[\duck@beret,rotate=-25] (0.13,2.25) ellipse (0.55 and 0.17); + \fill[\duck@beret,rotate=-25] (0.13,2.4) circle (0.08); +\fi +% % unicorn %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@unicorn - \draw[\duck@unicorn,fill=\duck@body!100,line width=1,rotate=25] - (1.50,1.4375)--(1.60,1.8375)--(1.70,1.4375); + \fill[\duck@unicorn,rotate=25] (1.48,1.4375)--(1.60,1.9)--(1.72,1.4375); + \fill[\duck@body!100,rotate=25] (1.50,1.43)--(1.60,1.8375)--(1.70,1.43); \fi % % icecream %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@icecream - \draw[\duck@cone,fill=\duck@cone!50!white, - line width=0.5,rotate=-20] - (0.35,1.20)--(0.50,0.60)--(0.75,1.20); - \draw[\duck@cone,fill=\duck@cone!50!white, - rotate=-20,line width=0.5] - (0.55,1.20) ellipse (0.20 and 0.09); - \fill[\duck@flavoura] (0.82,1.03) circle (0.12); - \fill[\duck@flavourb] (1.02,0.95) circle (0.12); - \fill[\duck@flavourc] (0.95,1.06) circle (0.12); + \fill[\duck@cone,rotate=-20] (0.35,1.20)--(0.50,0.60)--(0.75,1.20); + \fill[\duck@flavoura] (0.85,1.03) circle (0.12); + \fill[\duck@flavourb] (1.05,0.95) circle (0.12); + \fill[\duck@flavourc] (0.95,1.1) circle (0.12); \fi % % book %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -361,6 +455,14 @@ \node[rotate=-20, color=white] at (0.88,0.70) {\duck@book};% \fi % +% signpost %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@signpost + \fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.8,0.75) rectangle (0.9,1.75); + \fill[\duck@signcolour, rounded corners=1, rotate=-20] (0.4,1.7) rectangle (1.3,2.4); + \fill[\duck@signback, rounded corners=1, rotate=-20] (0.45,1.75) rectangle (1.25,2.35); + \node[rotate=-20, color=white] at (1.5,1.65) {\duck@signpost}; +\fi +% % magic hat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@magichat \path[preaction={fill, \duck@magichat!100},rotate=-5, @@ -370,8 +472,14 @@ % % magic wand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifduck@magicwand - \draw[line width=2.5,color=black] (0.90,0.90) -- (0.60,0.40); - \draw[line width=2.5,color=white] (0.85,0.8167) -- (0.80,0.7333); + \fill[black,rotate=-30] (0.27,1.23) rectangle (0.37,0.65); + \fill[white,rotate=-30] (0.27,1.13) rectangle (0.37,1.03); +\fi +% +% witch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@witch + \fill[\duck@witch,rotate=-15] (0.44,2.13) ellipse (0.75 and 0.17); + \fill[\duck@witch,rotate=-15] (0.05,2.2)--(0.45,3.2)--(0.82,2.2); \fi % % cricket bat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -380,6 +488,76 @@ \fill[\duck@cricket, rounded corners=1, rotate=-30] (0.5,0.8) rectangle (0.6,1.3); \fi % +% rollingpin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@rollingpin + \fill[\duck@rollingpin, rounded corners=2, rotate=-60] (-0.18,0.85) rectangle (0.08,1.75); + \fill[\duck@rollingpin, rounded corners=1, rotate=-60] (-0.1,0.65) rectangle (0.0,1.95); +\fi +% +% lightsaber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@lightsaber + \fill[\duck@lightsaber, rounded corners=1, rotate=-30] (0.5,0.9) rectangle (0.6,2.5); + \fill[gray!80!black, rounded corners=1, rotate=-30] (0.47,0.7) rectangle (0.63,1.2); +\fi +% +% cake %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@cake + \fill[\duck@cake] (1.00,0.50) ellipse (0.4 and 0.2); + \fill[\duck@cake] (0.6,0.5) rectangle (1.4,0.7); + \fill[\duck@cake] (1.00,0.70) ellipse (0.4 and 0.2); + \fill[\duck@cake!50!white] (0.75,0.75) rectangle (0.8,0.95); + \fill[\duck@cake!50!white] (1.2,0.75) rectangle (1.25,0.95); + \fill[\duck@cake!50!white] (0.975,0.65) rectangle (1.025,0.85); + \fill[white!85!yellow] (1.0,0.93) ellipse (0.03 and 0.06); + \fill[white!85!yellow] (1.225,1.03) ellipse (0.03 and 0.06); + \fill[white!85!yellow] (0.775,1.03) ellipse (0.03 and 0.06); +\fi +% +% pizza %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@pizza + \fill[brown] (1.00,0.60) ellipse (0.4 and 0.2); + \fill[red!70!black] (1.00,0.60) ellipse (0.34 and 0.16); + \fill[white!85!yellow] (1.15,0.65) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (0.81,0.57) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (0.95,0.68) ellipse (0.065 and 0.04); + \fill[white!85!yellow] (1.02,0.54) ellipse (0.065 and 0.04); + \fill[green!40!brown] (1.09,0.54) ellipse (0.07 and 0.02); + \fill[green!40!brown,rotate=20] (1.0,0.34) ellipse (0.07 and 0.02); + \fill[green!40!brown,rotate=-20] (0.9,1.05) ellipse (0.07 and 0.02); + \fill[green!40!brown] (1.00,0.60) ellipse (0.03 and 0.06); +\fi +% +% Hockey stick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@hockey + \fill[\duck@hockey, rounded corners=1, rotate=-30] (0.5,0.6) rectangle (0.6,2.1); + \fill[\duck@hockey, rounded corners=3] (0.2,0.2) rectangle (0.85,0.4); +\fi +% +% baguette %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@baguette + \fill[\duck@baguette!70!white, rounded corners=4, rotate=-30] (0.4,0.72) rectangle (0.7,2.0); + \fill[\duck@baguette!80!black, rotate=5] (1.44,1.1) ellipse (0.1 and 0.03) (1.30,0.9) ellipse (0.1 and 0.03) (1.16,0.7) ellipse (0.1 and 0.03) (1.02,0.5) ellipse (0.1 and 0.03); +\fi +% +% crown %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@crown + \path (0.7,1.95) rectangle (1.4,2.45); + \begin{pgfinterruptboundingbox} + \fill[\duck@crown,rotate=-10,xshift=-10,yshift=3] \duckpathcrown; + \end{pgfinterruptboundingbox} +\fi +% +% football %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifduck@football + \fill[\duck@football] (1.2,0.33) circle (0.32); + \begin{scope} + \clip (1.2,0.33) circle (0.32); + \fill[black] (1.06,0.30) -- (1.01,0.17) -- (1.14,0.08) -- (1.26,0.14) -- (1.20,0.28) -- cycle (1.37,0.14) -- (1.46,0.27) -- (1.59,0.27) -- (1.41,0.04) -- cycle (1.28,0.38) -- (1.22,0.52) -- (1.33,0.61) -- (1.45,0.51) -- (1.43,0.37) -- cycle (0.87,0.44) -- (1.02,0.40) -- (1.10,0.53) -- (1.07,0.62) -- (0.94,0.57) -- cycle; + \end{scope} +\fi +% +%\draw (current bounding box.north west) rectangle (current bounding box.south east);% For debugging bounding boxes +% }% from `\def\duck@draw{` at the very beginning %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -477,7 +655,18 @@ (1.3964,1.8658) .. controls (1.1071,2.3511) and (0.5189,2.1609) .. (0.4381,1.6816) .. controls (0.4575,1.9618) and (0.9007,2.2059) .. (1.1308,2.0390) .. controls (1.4703,1.7469) and (1.0343,1.5949) .. - (1.3385,1.4841) -- cycle; + (1.3385,1.4841) -- cycle +} + +\newcommand{\duckpathcape}{% + (0.225,0.966) .. controls (1.314,0.961) and (2.070,0.650) .. (2.042,1.245) .. controls (1.863,1.164) and (1.844,1.173) .. (1.792,1.340) .. controls (1.635,1.235) and (1.620,1.268) .. (1.567,1.393) .. controls (1.358,1.086) and (0.664,1.096) .. (0.460,1.110) .. controls (0.461,1.133) and (0.305,1.077) .. (0.235,0.966) -- cycle +} + +\newcommand{\duckpathcrown}{% + (0.71,2.06) .. controls (0.71,2.06) and (0.73,2.18) .. + (0.60,2.45) -- (0.83,2.26) -- (0.95,2.44) -- (1.07,2.26) -- (1.31,2.44) .. controls (1.15,2.19) and (1.20,2.06) .. + (1.20,2.06) .. controls (1.07,1.98) and (0.84,1.98) .. + (0.71,2.06) -- cycle } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -516,4 +705,88 @@ % 2378223223223223223223223223223223223223223782232 % 322378282232232232232232232232282878223223 % 223232232282828282322322323223 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% stripes for sports jerseys +% +% code contributed by Carla Maggi +% https://tex.stackexchange.com/a/387126/36296 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand*{\stripes}[1][]{\tikzset{% + /stripes/.cd,#1}\stripes@draw% +} + +\tikzset{ + /stripes/.cd, + color/.code = \def\stripes@color{#1}, + distance/.code = \def\stripes@distance{#1}, + width/.code = \def\stripes@width{#1}, + height/.code = \def\stripes@height{#1}, + initialx/.code = \def\stripes@initialx{#1}, + initialy/.code = \def\stripes@initialy{#1}, + rotate/.code = \def\stripes@rotate{#1}, + emblem/.code = \def\stripes@emblem{#1}, + % setting defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + color = black, + distance = 0.3, + width = 0.15, + height = 2.7, + initialx = 0.1, + initialy = -0.3, + rotate = -10, + emblem = \empty +} + +\def\stripes@draw{% + \path (0.1,0.1) rectangle (2.1,1.45); + \begin{pgfinterruptboundingbox} + \begin{scope} + \clip \duckpathjacket; + \foreach \shifta in {0,\stripes@distance,...,2.4}{% + \fill[\stripes@color,rotate around={\stripes@rotate:(1.2,0.9)}] + ($(\stripes@initialx,\stripes@initialy)+(\shifta,0)$) rectangle ($(\stripes@initialx,\stripes@initialy)+(\shifta,0)+(\stripes@width,\stripes@height)$); + } + \end{scope} + \end{pgfinterruptboundingbox} + \node at (wing) {\stripes@emblem }; +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%.........................%%%%%%%%%%%%%%%%%%%......................... +%....................%%%%%%%%%............%%%%%%%%.................... +%................%%%%%%....%%...................%%%%%%................ +%.............%%%%%.......%%%.......................%%%%%............. +%...........%%%%........%%%%%%%%%...................%%%%%%%........... +%.........%%%........%%%%%%%%%%%%%%%%..............%%%%%%%%%%......... +%.......%%%.......%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%....... +%......%%%...%%%%%%%%%%%%%%%%%%%%%%%%%%..............%%%%%%%%%%%...... +%.....%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%................%%%%%%%%%%%..... +%...%%%%........%%%%%%%%%%%%%%%%%%%%%...................%%%%%%%%%%%... +%...%%%..........%%%%%%%%%%%%%%%%%%%.....................%%%%%%%%%%... +%..%%%............%%%%%%%%%%%%%%%%%.......................%%%%%%%%%%.. +%.%%%%............%%%%%%%%%%%%%%%%%........................%%%%%%%%%%. +%.%%%..............%%%%%%%.......%%%......................%%%.....%%%. +%%%%..............%%...............%%%...................%%%.......%%% +%%%..............%%.................%%%..................%%.........%% +%%%%............%%%...................%%%...............%%..........%% +%%%%...........%%%.....................%%%.............%%...........%% +%%%%%..........%%........................%%%%%%%%%%%%%%%%...........%% +%%%%%........%%%........................%%%%%%%%%%%%%%%%%%.........%%% +%.%%%%%%%%%%%%%%%......................%%%%%%%%%%%%%%%%%%%.........%%. +%.%%%%%%%%%%%%%%%%.....................%%%%%%%%%%%%%%%%%%%........%%%. +%..%%%%%%%%%%%%%%%%...................%%%%%%%%%%%%%%%%%%%%%.......%%.. +%...%%%%%%%%%%%%%%%%%................%%%%%%%%%%%%%%%%%%%%%%......%%... +%...%%%%%%%%%%%%%%%%%%............%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.... +%.....%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%....%%%..... +%......%%%%%%%%%%%%%%%%................%%%%%%%%%%%%%%%%......%%%...... +%.......%%%%%%%%%%%%%%....................%%%%%%%%%%........%%%....... +%.........%%%%%%%%%%%........................%%%%.........%%%......... +%...........%%%%%%%%%........................%%........%%%%........... +%.............%%%%%%%%%.....................%%......%%%%%............. +%................%%%%%%%%.................%%%...%%%%%%................ +%....................%%%%%%%%......%%%%%%%%%%%%%%%.................... +%..........................%%%%%%%%%%%%%%%%%.......................... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file -- cgit v1.2.3