diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-17 21:39:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-17 21:39:31 +0000 |
commit | 33ae88e5a364265d921e4db20d33f86d401a095f (patch) | |
tree | d2d34a5e1e9bec0d7dcf76600fac0c77585d16b7 /Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty | |
parent | ea174d11ebe4836a256865f9b5c7f3b1e9b72d72 (diff) |
tikzlings (17mar21)
git-svn-id: svn://tug.org/texlive/trunk@58469 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty index c29338cf6bc..c8360574afb 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-sheep.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-sheep}[2020/12/04 version v0.4 Drawing sheep in TikZ] +\ProvidesPackage{tikzlings-sheep}[2021/03/17 version v0.5 Drawing sheep in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -36,6 +36,7 @@ \newif\ifsheep@monocle \newif\ifsheep@blush \newif\ifsheep@back +\newif\ifsheep@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -52,6 +53,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% body/.code = \def\sheep@body{#1}, body = brown!50!darkgray!97!yellow, + eye/.code = \def\sheep@eye{#1}, + eye = \sheep@body!50!black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % options @@ -61,6 +64,10 @@ monocle/.code = \sheep@monocletrue, 3D/.code = \sheep@threeDtrue, back/.code = \sheep@backtrue, + contour/.code = \sheep@contourtrue + \def\sheep@contour{#1}, + contour/.default = black, + outline/.forward to = /sheep/contour, } \def\sheep@draw{% @@ -84,14 +91,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifsheep@threeD \def\sheep@part@draw[##1]{\shade[ball color=##1]} \else - \def\sheep@part@draw[##1]{\fill[##1]} + \ifsheep@contour + \def\sheep@part@draw[##1]{\draw[##1,\sheep@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\sheep@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -131,11 +142,11 @@ \fi % % Hair %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\sheep@part@draw[\sheep@body!50!darkgray,decorate,decoration={bumps}] (-0.275,1.98) -- (-0.2,2.2) -- (-0.008,2.2) -- (0.2,2.2) -- (0.275,1.98) -- cycle; +\sheep@part@draw[\sheep@body!50!darkgray,decorate,decoration={bumps,amplitude=\scalingfactor*2.5pt,segment length=\scalingfactor*10pt}] (-0.275,1.98) -- (-0.2,2.2) -- (-0.008,2.2) -- (0.2,2.2) -- (0.275,1.98) -- cycle; % % Tail if back %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifsheep@back - \filldraw[\sheep@body!45!white!95!orange,rounded corners=0.1pt] (0,0.7) -- (0.08, 0.3236) arc (0:-180:2pt) -- cycle; + \sheep@part@draw[\sheep@body!45!white!95!orange,rounded corners=0.1pt] (0,0.7) -- (0.08, 0.3236) arc (0:-180:2pt) -- cycle; \fi % % Show details only from the front %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -156,12 +167,16 @@ % % Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifsheep@back\else - \sheep@part@draw[\sheep@body!50!black] (0.2, 1.66) circle[radius=0.06]; - \sheep@part@draw[\sheep@body!50!black] (-0.2, 1.66) circle[radius=0.06]; + \sheep@part@draw[\sheep@eye] (0.2, 1.66) circle[radius=0.06]; + \sheep@part@draw[\sheep@eye] (-0.2, 1.66) circle[radius=0.06]; \fi % % Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\draw[\sheep@body!50!black,line width=\scalingfactor*0.8pt,line cap=round] (0.16,1.43) arc [start angle=-30, end angle=-90, radius=0.16] -- (0,1.164) -- (0,1.3485) arc [start angle=-90, end angle=-150, radius=0.16]; +\ifsheep@contour + \draw[\sheep@contour,line width=\scalingfactor*0.8pt,line cap=round] (0.16,1.43) arc [start angle=-30, end angle=-150, radius=0.185] (0.0,1.335) -- (0,1.175); +\else + \draw[\sheep@body!50!black,line width=\scalingfactor*0.8pt,line cap=round] (0.16,1.43) arc [start angle=-30, end angle=-150, radius=0.185] (0.0,1.335) -- (0,1.175); +\fi % % Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \sheep@part@draw[\sheep@body!45!white!95!orange] (0.3216,0.13) arc (-15:195:0.10) -- (0.16,0.13) to [bend left] (0.25,0.13) -- cycle; @@ -172,8 +187,13 @@ % % Blush %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifsheep@blush - \fill[red,path fading=sheep@blush] (-0.25, 1.5) circle[radius=0.1]; - \fill[red,path fading=sheep@blush] (0.25, 1.5) circle[radius=0.1]; + \ifsheep@contour + \fill[\sheep@contour,path fading=sheep@blush] (-0.25, 1.5) circle[radius=0.1]; + \fill[\sheep@contour,path fading=sheep@blush] (0.25, 1.5) circle[radius=0.1]; + \else + \fill[red,path fading=sheep@blush] (-0.25, 1.5) circle[radius=0.1]; + \fill[red,path fading=sheep@blush] (0.25, 1.5) circle[radius=0.1]; + \fi \fi % % monocle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |