summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty52
1 files changed, 40 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty
index 8a5baef368b..73d528f7eb8 100644
--- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty
+++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-squirrels.sty
@@ -12,7 +12,7 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{tikzlings-squirrels}[2020/12/04 version v0.4 Drawing squirrels in TikZ]
+\ProvidesPackage{tikzlings-squirrels}[2021/03/17 version v0.5 Drawing squirrels in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
@@ -30,6 +30,7 @@
\newif\ifsquirrel@threeD
\newif\ifsquirrel@back
+\newif\ifsquirrel@contour
\tikzset{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -46,6 +47,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
body/.code = \def\squirrel@body{#1},
body = brown!40!gray!90!red,
+ eye/.code = \def\squirrel@eye{#1},
+ eye = white,
+ pupil/.code = \def\squirrel@pupil{#1},
+ pupil = black,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% options
@@ -53,6 +58,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3D/.code = \squirrel@threeDtrue,
back/.code = \squirrel@backtrue,
+ contour/.code = \squirrel@contourtrue
+ \def\squirrel@contour{#1},
+ contour/.default = black,
+ outline/.forward to = /squirrel/contour,
}
\def\squirrel@draw{%
@@ -77,17 +86,21 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% switch between 2D and 3D, from
+% switch between 2D, 3D and contours, from
% https://chat.stackexchange.com/transcript/message/45991801#45991801
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifsquirrel@threeD
\def\squirrel@part@draw[##1]{\shade[ball color=##1]}
\else
- \def\squirrel@part@draw[##1]{\fill[##1]}
+ \ifsquirrel@contour
+ \def\squirrel@part@draw[##1]{\draw[##1,\squirrel@contour,fill=white,line width=\scalingfactor*0.4pt]}
+ \else
+ \def\squirrel@part@draw[##1]{\fill[##1]}
+ \fi
\fi
%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Body parts (center: x=0)
%
@@ -126,7 +139,16 @@
(-0.1920,1.9906) .. controls (-0.1657,2.0780) and (-0.1839,2.1332) .. (-0.1839,2.1332) .. controls (-0.1839,2.1332) and (-0.1123,2.1773) .. (-0.0941,2.0720) .. controls (-0.0716,2.0156) and (-0.0753,1.9519) .. (-0.1023,1.9293) .. controls (-0.1293,1.9068) and (-0.1696,1.9342) .. (-0.1920,1.9906) -- cycle;
%
% Head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\squirrel@part@draw[\squirrel@body] (0,1.75) circle[radius=0.3] (0.2,1.6) circle[radius=0.15] (-0.2,1.6) circle[radius=0.15];
+\ifsquirrel@contour
+ \squirrel@part@draw[\squirrel@body] (0,1.75) circle[radius=0.3];
+ \squirrel@part@draw[\squirrel@body] (0.2,1.6) circle[radius=0.15];
+ \squirrel@part@draw[\squirrel@body] (-0.2,1.6) circle[radius=0.15];
+ \ifsquirrel@back
+ \squirrel@part@draw[\squirrel@body] (0,1.75) circle[radius=0.3];
+ \fi
+\else
+ \squirrel@part@draw[\squirrel@body] (0,1.75) circle[radius=0.3] (0.2,1.6) circle[radius=0.15] (-0.2,1.6) circle[radius=0.15];
+\fi
%
\ifsquirrel@back
% Tail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -138,15 +160,21 @@
\squirrel@part@draw[\squirrel@body!70!brown!60!black] (0,1.66) ellipse[x radius=0.06, y radius=0.03];
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\squirrel@part@draw[white] (0.07,1.78) ellipse[x radius=0.05, y radius=0.07];
-\squirrel@part@draw[white] (-0.07,1.78) ellipse[x radius=0.05, y radius=0.07];
-\squirrel@part@draw[black] (0.07,1.76) ellipse[x radius=0.017, y radius=0.027];
-\squirrel@part@draw[black] (-0.07,1.76) ellipse[x radius=0.017, y radius=0.027];
+\squirrel@part@draw[\squirrel@eye] (0.07,1.78) ellipse[x radius=0.05, y radius=0.07];
+\squirrel@part@draw[\squirrel@eye] (-0.07,1.78) ellipse[x radius=0.05, y radius=0.07];
+\squirrel@part@draw[\squirrel@pupil] (0.07,1.76) ellipse[x radius=0.017, y radius=0.027];
+\squirrel@part@draw[\squirrel@pupil] (-0.07,1.76) ellipse[x radius=0.017, y radius=0.027];
%
% Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[white] (-0.025,1.567) rectangle ++(0.02,0.03);
-\fill[white] (0.025,1.567) rectangle ++(-0.02,0.03);
-\draw[\squirrel@body!70!brown!60!black,line width=\scalingfactor*0.4pt] (-0.15,1.61) .. controls (-0.15,1.61) and (-0.15,1.52) .. (0.0,1.61) .. controls (0.15,1.52) and (0.15,1.61) .. (0.15,1.61);
+\ifsquirrel@contour
+ \draw[\squirrel@contour,fill=white,line width=\scalingfactor*0.4pt] (-0.025,1.567) rectangle ++(0.02,0.03);
+ \draw[\squirrel@contour,fill=white,line width=\scalingfactor*0.4pt] (0.025,1.567) rectangle ++(-0.02,0.03);
+ \draw[\squirrel@contour,line width=\scalingfactor*0.4pt] (-0.15,1.61) .. controls (-0.15,1.61) and (-0.15,1.52) .. (0.0,1.61) .. controls (0.15,1.52) and (0.15,1.61) .. (0.15,1.61);
+\else
+ \fill[white] (-0.025,1.567) rectangle ++(0.02,0.03);
+ \fill[white] (0.025,1.567) rectangle ++(-0.02,0.03);
+ \draw[\squirrel@body!70!brown!60!black,line width=\scalingfactor*0.4pt] (-0.15,1.61) .. controls (-0.15,1.61) and (-0.15,1.52) .. (0.0,1.61) .. controls (0.15,1.52) and (0.15,1.61) .. (0.15,1.61);
+\fi
%
% Arms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\squirrel@part@draw[\squirrel@body!70!brown!50!darkgray] (0.2,0.85) ellipse[x radius=0.22, y radius=0.11, rotate=70];