diff options
Diffstat (limited to 'graphics/pgf/contrib/tikzlings/tikzlings-mice.sty')
-rw-r--r-- | graphics/pgf/contrib/tikzlings/tikzlings-mice.sty | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/graphics/pgf/contrib/tikzlings/tikzlings-mice.sty b/graphics/pgf/contrib/tikzlings/tikzlings-mice.sty index c1a0ec4f12..96cca7f2f7 100644 --- a/graphics/pgf/contrib/tikzlings/tikzlings-mice.sty +++ b/graphics/pgf/contrib/tikzlings/tikzlings-mice.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-mice}[2020/12/04 version v0.4 Drawing mice in TikZ] +\ProvidesPackage{tikzlings-mice}[2021/03/17 version v0.5 Drawing mice in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -34,6 +34,7 @@ \newif\ifmouse@leftstep \newif\ifmouse@rightstep \newif\ifmouse@back +\newif\ifmouse@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -50,6 +51,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% body/.code = \def\mouse@body{#1}, body = gray!90!white, + eye/.code = \def\mouse@eye{#1}, + eye = \mouse@body!50!black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % options @@ -65,6 +68,10 @@ rightstep/.code = \mouse@rightsteptrue, right step/.forward to = /mouse/rightstep, back/.code = \mouse@backtrue, + contour/.code = \mouse@contourtrue + \def\mouse@contour{#1}, + contour/.default = black, + outline/.forward to = /mouse/contour, } \def\mouse@draw{% @@ -88,14 +95,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifmouse@threeD \def\mouse@part@draw[##1]{\shade[ball color=##1]} \else - \def\mouse@part@draw[##1]{\fill[##1]} + \ifmouse@contour + \def\mouse@part@draw[##1]{\draw[##1,\mouse@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\mouse@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -165,19 +176,28 @@ \mouse@part@draw[\mouse@body!65!white,rotate around={\mouse@rotatearms:(-0.47,1.15)}] (-0.47,0.93) ellipse[x radius=0.13, y radius=0.24]; % % Wiskers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[\mouse@body!50!black] (0.0788, 1.2046) .. controls (0.1658, 1.2199) and (0.2086, 1.1539) .. (0.2956, 1.1386) -- (0.2956, 1.1486) .. controls (0.2097, 1.1637) and (0.1648, 1.2197) .. (0.0788, 1.2046) -- cycle; -\fill[\mouse@body!50!black] (-0.0788, 1.2046) .. controls (-0.1658, 1.2199) and (-0.2087, 1.1539) .. (-0.2956, 1.1386) -- (-0.2956, 1.1486) .. controls (-0.2097, 1.1637) and (-0.1648, 1.2197) .. (-0.0788, 1.2046) -- cycle; -\fill[\mouse@body!50!black] (0.0752, 1.2181) .. controls (0.1583, 1.2483) and (0.2171, 1.2209) .. (0.3002, 1.1907) -- (0.3002, 1.2007) .. controls (0.2174, 1.2308) and (0.158, 1.2482) .. (0.0752, 1.2181) -- cycle; -\fill[\mouse@body!50!black] (-0.0752, 1.2181) .. controls (-0.1583, 1.2483) and (-0.2171, 1.2209) .. (-0.3002, 1.1907) -- (-0.3002, 1.2007) .. controls (-0.2174, 1.2308) and (-0.158, 1.2482) .. (-0.0752, 1.2181) -- cycle; -\fill[\mouse@body!50!black] (0.0671, 1.2343) .. controls (0.1414, 1.2825) and (0.2182, 1.3064) .. (0.2925, 1.2582) -- (0.2925, 1.2682) .. controls (0.2179, 1.3166) and (0.1417, 1.2827) .. (0.0671, 1.2343) -- cycle; -\fill[\mouse@body!50!black] (-0.0671, 1.2343) .. controls (-0.1414, 1.2825) and (-0.2182, 1.3064) .. (-0.2925, 1.2582) -- (-0.2925, 1.2682) .. controls (-0.2179, 1.3166) and (-0.1417, 1.2827) .. (-0.0671, 1.2343) -- cycle; +\ifmouse@contour + \fill[\mouse@contour] (0.0788, 1.2046) .. controls (0.1658, 1.2199) and (0.2086, 1.1539) .. (0.2956, 1.1386) -- (0.2956, 1.1486) .. controls (0.2097, 1.1637) and (0.1648, 1.2197) .. (0.0788, 1.2046) -- cycle; + \fill[\mouse@contour] (-0.0788, 1.2046) .. controls (-0.1658, 1.2199) and (-0.2087, 1.1539) .. (-0.2956, 1.1386) -- (-0.2956, 1.1486) .. controls (-0.2097, 1.1637) and (-0.1648, 1.2197) .. (-0.0788, 1.2046) -- cycle; + \fill[\mouse@contour] (0.0752, 1.2181) .. controls (0.1583, 1.2483) and (0.2171, 1.2209) .. (0.3002, 1.1907) -- (0.3002, 1.2007) .. controls (0.2174, 1.2308) and (0.158, 1.2482) .. (0.0752, 1.2181) -- cycle; + \fill[\mouse@contour] (-0.0752, 1.2181) .. controls (-0.1583, 1.2483) and (-0.2171, 1.2209) .. (-0.3002, 1.1907) -- (-0.3002, 1.2007) .. controls (-0.2174, 1.2308) and (-0.158, 1.2482) .. (-0.0752, 1.2181) -- cycle; + \fill[\mouse@contour] (0.0671, 1.2343) .. controls (0.1414, 1.2825) and (0.2182, 1.3064) .. (0.2925, 1.2582) -- (0.2925, 1.2682) .. controls (0.2179, 1.3166) and (0.1417, 1.2827) .. (0.0671, 1.2343) -- cycle; + \fill[\mouse@contour] (-0.0671, 1.2343) .. controls (-0.1414, 1.2825) and (-0.2182, 1.3064) .. (-0.2925, 1.2582) -- (-0.2925, 1.2682) .. controls (-0.2179, 1.3166) and (-0.1417, 1.2827) .. (-0.0671, 1.2343) -- cycle; +\else + \fill[\mouse@body!50!black] (0.0788, 1.2046) .. controls (0.1658, 1.2199) and (0.2086, 1.1539) .. (0.2956, 1.1386) -- (0.2956, 1.1486) .. controls (0.2097, 1.1637) and (0.1648, 1.2197) .. (0.0788, 1.2046) -- cycle; + \fill[\mouse@body!50!black] (-0.0788, 1.2046) .. controls (-0.1658, 1.2199) and (-0.2087, 1.1539) .. (-0.2956, 1.1386) -- (-0.2956, 1.1486) .. controls (-0.2097, 1.1637) and (-0.1648, 1.2197) .. (-0.0788, 1.2046) -- cycle; + \fill[\mouse@body!50!black] (0.0752, 1.2181) .. controls (0.1583, 1.2483) and (0.2171, 1.2209) .. (0.3002, 1.1907) -- (0.3002, 1.2007) .. controls (0.2174, 1.2308) and (0.158, 1.2482) .. (0.0752, 1.2181) -- cycle; + \fill[\mouse@body!50!black] (-0.0752, 1.2181) .. controls (-0.1583, 1.2483) and (-0.2171, 1.2209) .. (-0.3002, 1.1907) -- (-0.3002, 1.2007) .. controls (-0.2174, 1.2308) and (-0.158, 1.2482) .. (-0.0752, 1.2181) -- cycle; + \fill[\mouse@body!50!black] (0.0671, 1.2343) .. controls (0.1414, 1.2825) and (0.2182, 1.3064) .. (0.2925, 1.2582) -- (0.2925, 1.2682) .. controls (0.2179, 1.3166) and (0.1417, 1.2827) .. (0.0671, 1.2343) -- cycle; + \fill[\mouse@body!50!black] (-0.0671, 1.2343) .. controls (-0.1414, 1.2825) and (-0.2182, 1.3064) .. (-0.2925, 1.2582) -- (-0.2925, 1.2682) .. controls (-0.2179, 1.3166) and (-0.1417, 1.2827) .. (-0.0671, 1.2343) -- cycle; +\fi % % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \mouse@part@draw[\mouse@body!50!black] (0, 1.248) circle[radius=0.09]; % % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\mouse@part@draw[\mouse@body!50!black] (0.23, 1.68) circle[radius=0.05]; -\mouse@part@draw[\mouse@body!50!black] (-0.23, 1.68) circle[radius=0.05]; +\mouse@part@draw[\mouse@eye] (0.23, 1.68) circle[radius=0.05]; +\mouse@part@draw[\mouse@eye] (-0.23, 1.68) circle[radius=0.05]; % \fi % adding hook for users to customise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |