diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty index da37457c67c..92b3b901228 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-cats.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-cats}[2020/12/04 version v0.4 Drawing cats in TikZ] +\ProvidesPackage{tikzlings-cats}[2021/03/17 version v0.5 Drawing cats in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -58,6 +58,7 @@ \newif\ifcat@threeD \newif\ifcat@schroedinger \newif\ifcat@back +\newif\ifcat@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -76,8 +77,9 @@ body = gray!30!black, whiskers/.code = \def\cat@whiskers{#1}, whiskers = gray!50!white, - eyes/.code = \def\cat@eyes{#1}, - eyes = yellow!80!orange, + eye/.code = \def\cat@eye{#1}, + eye = yellow!80!orange, + eyes/.forward to = /cat/eye, pupil/.code = \def\cat@pupil{#1}, pupil = black, pupilwidth/.code = \def\cat@pupil@width{#1}\edef\cat@pupil@offset{\strip@pt\dimexpr#1pt/4}, @@ -99,6 +101,11 @@ 3D/.code = \cat@threeDtrue, schroedinger/.code = \cat@schroedingertrue, back/.code = \cat@backtrue, + contour/.code = \cat@contourtrue + \def\cat@contour{#1} + \def\cat@whiskers{#1}, + contour/.default = black, + outline/.forward to = /cat/contour, } \def\cat@draw{% @@ -123,14 +130,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifcat@threeD \def\cat@part@draw[##1]{\shade[ball color=##1]} \else - \def\cat@part@draw[##1]{\fill[##1]} + \ifcat@contour + \def\cat@part@draw[##1]{\draw[##1,\cat@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\cat@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -174,8 +185,8 @@ \ifcat@back\else % % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\cat@part@draw[\cat@eyes] (-0.1014, 1.7491) .. controls (-0.1014, 1.7491) and (-0.1451, 1.7171) .. (-0.1841, 1.7284) .. controls (-0.2231, 1.7397) and (-0.2427, 1.79) .. (-0.2427, 1.79) .. controls (-0.2427, 1.79) and (-0.1992, 1.8221) .. (-0.1602, 1.8108) .. controls (-0.1212, 1.7995) and (-0.1014, 1.7491) .. (-0.1014, 1.7491) -- cycle; -\cat@part@draw[\cat@eyes] (0.1014, 1.7491) .. controls (0.1014, 1.7491) and (0.1451, 1.7171) .. (0.1841, 1.7284) .. controls (0.2231, 1.7397) and (0.2427, 1.79) .. (0.2427, 1.79) .. controls (0.2427, 1.79) and (0.1992, 1.8221) .. (0.1602, 1.8108) .. controls (0.1212, 1.7995) and (0.1014, 1.7491) .. (0.1014, 1.7491) -- cycle; +\cat@part@draw[\cat@eye] (-0.1014, 1.7491) .. controls (-0.1014, 1.7491) and (-0.1451, 1.7171) .. (-0.1841, 1.7284) .. controls (-0.2231, 1.7397) and (-0.2427, 1.79) .. (-0.2427, 1.79) .. controls (-0.2427, 1.79) and (-0.1992, 1.8221) .. (-0.1602, 1.8108) .. controls (-0.1212, 1.7995) and (-0.1014, 1.7491) .. (-0.1014, 1.7491) -- cycle; +\cat@part@draw[\cat@eye] (0.1014, 1.7491) .. controls (0.1014, 1.7491) and (0.1451, 1.7171) .. (0.1841, 1.7284) .. controls (0.2231, 1.7397) and (0.2427, 1.79) .. (0.2427, 1.79) .. controls (0.2427, 1.79) and (0.1992, 1.8221) .. (0.1602, 1.8108) .. controls (0.1212, 1.7995) and (0.1014, 1.7491) .. (0.1014, 1.7491) -- cycle; % % Pupils %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \cat@part@draw[\cat@pupil] @@ -236,6 +247,22 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% switch between 2D, 3D and contours, from +% https://chat.stackexchange.com/transcript/message/45991801#45991801 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifcat@threeD + \def\cat@part@draw[##1]{\shade[ball color=##1]} +\else + \ifcat@contour + \def\cat@part@draw[##1]{\draw[##1,\cat@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\cat@part@draw[##1]{\fill[##1]} + \fi +\fi +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Drawing the tomebstone % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -245,8 +272,7 @@ \csname tikzlinghookbackground\endcsname % % Stone %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[gray] (-0.55,0.4) rectangle (0.55,1.5); -\fill[gray] (0,1.5) circle[radius=0.55]; +\cat@part@draw[gray] (-0.55,0.4) -- (-0.55,1.5) arc [start angle=180, end angle=0, radius=0.55] -- (0.55,0.4) -- cycle; \node[scale=\scalingfactor] at (0,1.3) {R.I.P.}; % % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -254,14 +280,18 @@ \csname tikzlinghookbelly\endcsname % % soil %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[brown!65!black] (1,0.15) arc [start angle=50, end angle=130, radius=1.56] -- cycle; +\cat@part@draw[brown!65!black] (1,0.15) arc [start angle=50, end angle=130, radius=1.56] -- cycle; % % flower -\draw[green!50!brown,line width=\scalingfactor*0.4pt] (-0.01,0.3) arc [start angle=-15, end angle=30, radius=0.7]; -\fill[green!50!brown] (-0.1377, 0.7384) .. controls (-0.1775, 0.5828) and (-0.1479, 0.4649) .. (0.0072, 0.4246) .. controls (0.0570, 0.5636) and (-0.1529, 0.6447) .. (-0.1377, 0.7384) -- cycle; -\fill[green!50!brown] (0.1527, 0.7334) .. controls (0.1925, 0.5778) and (0.1629, 0.4599) .. (0.0178, 0.4196) .. controls (-0.0420, 0.5586) and (0.1679, 0.6397) .. (0.1527, 0.7334) -- cycle; +\ifcat@contour + \draw[\cat@contour,line width=\scalingfactor*0.4pt] (-0.01,0.3) arc [start angle=-15, end angle=30, radius=0.7]; +\else + \draw[green!50!brown,line width=\scalingfactor*0.4pt] (-0.01,0.3) arc [start angle=-15, end angle=30, radius=0.7]; +\fi +\cat@part@draw[green!50!brown] (-0.1377, 0.7384) .. controls (-0.1775, 0.5828) and (-0.1479, 0.4649) .. (0.0072, 0.4246) .. controls (0.0570, 0.5636) and (-0.1529, 0.6447) .. (-0.1377, 0.7384) -- cycle; +\cat@part@draw[green!50!brown] (0.1527, 0.7334) .. controls (0.1925, 0.5778) and (0.1629, 0.4599) .. (0.0178, 0.4196) .. controls (-0.0420, 0.5586) and (0.1679, 0.6397) .. (0.1527, 0.7334) -- cycle; \foreach \i in {0,51.42857,...,359}{ - \fill[yellow!50!white,rotate around={\i:(-0.0865, 0.8219)}] (-0.087, 0.822) .. controls (-0.087, 0.822) and (-0.1635, 0.6638) .. (-0.0818, 0.6653) .. controls (-0.0066, 0.6646) and (-0.087, 0.822) .. (-0.087, 0.822) -- cycle; + \cat@part@draw[yellow!50!white,rotate around={\i:(-0.0865, 0.8219)}] (-0.087, 0.822) .. controls (-0.087, 0.822) and (-0.1635, 0.6638) .. (-0.0818, 0.6653) .. controls (-0.0066, 0.6646) and (-0.087, 0.822) .. (-0.087, 0.822) -- cycle; } % % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |