summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikzpingus/tikzpingus-horse.lib.tex
blob: dad22a8adaf85f4f1c18f078609f8e0792fd8390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
% Florian Sihler, 2022
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
% TODO: get all of this customizable
\colorlet{base@a}{lightgray!95!black}
\colorlet{base@b}{lightgray!79!black}

\colorlet{a}{lightgray!63!black}
\colorlet{b}{lightgray!81!black}
\def\basew{12}
\def\pingu@@horse@scale{.1}

\def\pingu@@horse@@main{(1.275,.55) -- ++(.1,.2) -- ++(-.25,.25) to[bend right=4] ++(-.425,1.75) to[bend left=15] ++(.05,.2) to[bend right=30] ++(-.1,1.9) to[bend left=30] ++(0,1.65) coordinate(@back) to[bend left=30] ++(2,.625) to[bend right=18,looseness=.8] ++(3.25,-.1) [rounded corners=2*\pingu@@horse@scale] coordinate(@hair) to[out=34,in=185] ++(3,1.3) to[bend left=19] coordinate[pos=.5](@ear) ++(.85,-.4) to[bend left=5] ++(.24,-.45) to[bend right=20] ++(0,-.7) to[bend left=2] ++(.1,-.55) to[out=-85,in=-60,looseness=.75] ++(-.475,-.35) coordinate(@mouth) to[out=-135,in=-120] ++(-.37,.25) -- ++(0,.1)
to[out=125,in=-68] ++(-.58,.615) coordinate (@mouth-low)
to[out=215,in=80] ++(-1.25,-2) to[bend left=24] ++(-.65,-1) to[out=258,in=86] ++(-.42,-1.25)  to[bend left=3] ++(-.2,-.6) to[bend right=10] ++(-.14,-1.15) to[bend left=2] coordinate[pos=.35] (@hooffront) ++(.355,-.565) to[bend left=15] ++(-.4,-.075) to[bend left=10] ++(-.28,.1) to[bend left=9] ++(.06,.3) to[bend right=9] ++(-.2,.4) to[out=80,in=-80] ++(.138,1.4) to[out=70,in=-103] ++(.2,1.3) to[bend right=10] ++(-.225,.44) coordinate (@frontleg) to[out=196,in=-25] ++(-3.3,.575) coordinate (@backleg) to[bend right=10] ++(-.8,-1.5) to[bend right=20] ++(.1,-2.35) -- ++(.2,-.25) to[bend right=8] ++(.15,-.26) to[bend left=10] ++(-.55,-.05) -- cycle}

% #1 is the wing for the color and key assignments
\def\pingu@@drawer@horse#1{
% this ensures all coordinates are set in place
% i know this i inefficient, but atm this is of no greater
% concern -- i can not use layers as they would clash with that
% of the penguin and who wants that... no one does!
% penguins deserve freedom!
\path \pingu@@horse@@main;

% no we draw "behind" the horse:

% Sockel
\csname if@pingu@x@horse@#1@base@\endcsname
\pingu@block[draw=\csname pingu@color@horse#1@base@shade@draw\endcsname,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@base@shade\endcsname} (4.35-\basew/2,.433) -- ++(0,-.5) arc(180:360:\basew/2 and 1) -- ++(0,.5) arc(360:180:\basew/2 and 1);
\pingu@block[draw=\csname pingu@color@horse#1@base@draw\endcsname,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@base\endcsname} (4.35,.433) ellipse[x radius=\basew/2,y radius=1];
\fi

\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale](@frontleg) to[out=266,in=85] ++(.09,-.5) to[bend left=10] ++(-.15,-.8)
to[bend right=7] ++(-.05,-.2) to[bend left=13] ++(-.2,-1.15) to[bend right=13] ++(.15,-.2) to[bend left=10] ++(-.07,-.3) to[bend right=100] ++(.45,-.1) to[bend right=10] ([yshift=5mm]@frontleg) -- cycle;

\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale](@backleg) to[out=-115,in=130] ++(-.3,-3.65) -- ++(.2,-.3) to[bend left] ++(-.5,-.1)
-- ++(-.05,.15) -- ++(0,.15) to[bend left=60] cycle;

\pingu@block[draw=\csname pingu@color@horse#1@tail@draw\endcsname,line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@tail\endcsname} [rounded corners=1*\pingu@@horse@scale](@back) to[out=215,in=90] ++(-.4,-2.5) to[out=270,in=92] ++(0,-2.8) [sharp corners] to[bend right=20] ++(.6,0) to[bend right=10] cycle;

% back ear
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.35pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=.2mm,yshift=-1.5mm]@ear) to[bend left=20] ++(.373,.565) coordinate(@) to[bend left=10] ++(-.15,-.75);

% and here comes the wheeee (imagine-horse-sound)
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale] \pingu@@horse@@main;

\pingu@draw[line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.2mm]@mouth-low) to[bend left=12] ++(.06,.65);
\pingu@draw[line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@mouth\endcsname} ([yshift=-.33mm]@mouth) -- ++(-.035,.225);

\pingu@draw[line width=1.75pt*\pingu@@horse@scale,line join=round]{\csname pingu@color@horse#1@nose\endcsname} ([xshift=3.85mm,yshift=2.45mm]@mouth) to[out=140,in=10] ++(-.17,-.074) to[bend right=49] cycle;

\pingu@draw[line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.35mm]@frontleg) to[bend left=12] ++(.01,.325);
\pingu@draw[line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.2mm]@backleg) to[bend right=13] ++(.25,.425);

\pingu@block[draw=\csname pingu@color@horse#1@mane@draw\endcsname,line width=1.75pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@mane\endcsname} [rounded corners=1*\pingu@@horse@scale](@hair) to[out=34,in=185] ++(3,1.3) to[bend left=10] ++(.415,-.1) -- ++(-.1,-.4) to[out=194,in=30] ([yshift=-11.5mm,xshift=1.5mm]@hair) -- cycle;

\pingu@block[draw=\csname pingu@color@horse#1@thatch@draw\endcsname,line width=1.35pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@thatch\endcsname} [rounded corners=1*\pingu@@horse@scale]([xshift=2mm,yshift=-1mm]@ear) -- ++(-.1,-.3275) to[bend left=4] ++(.455,-.175) to[bend right=9] cycle;

% ear
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.35pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=-.75mm,yshift=-1mm]@ear) to[bend left=20] ++(.393,.585) coordinate(@) to[bend right=10] ++(-.15,-.7);
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=1.35pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} (@) to[bend right=7] ++(-.15,-.7) to[bend right=14] cycle;


% the eye; this is no error it has draw as fill
\pingu@block{\csname pingu@color@horse#1@eyes\endcsname} [rounded corners=.25*\pingu@@horse@scale] ([xshift=3mm,yshift=-7.5mm]@ear) to[bend right=20] ++(.125,-.2) to[bend right=50] ++(.1,.125) to[bend left=15] cycle;
}

\newif\if@pingu@x@horse@left@flip@
\newif\if@pingu@x@horse@right@flip@
\newif\if@pingu@x@horse@left@base@
\newif\if@pingu@x@horse@right@base@
\pingu@create@wing@extra{horse}{%
    horse \@lr/.code                       = {\pingu@set@extra{horse\@lr}{true}\pingu@color{horse\@lr}{##1}},
    horse \@lr/.default                    = pingu@bronze!80!pingu@black,
    horse \@lr\space flip/.is if           = @pingu@x@horse@\@lr @flip@,
    horse \@lr\space has base/.is if       = @pingu@x@horse@\@lr @base@,
    horse \@lr\space draw/.code            = \pingu@color{horse\@lr @draw}{##1},%
    horse \@lr\space mane/.code            = \pingu@color{horse\@lr @mane}{##1},%
    horse \@lr\space mane draw/.code       = \pingu@color{horse\@lr @mane@draw}{##1},%
    horse \@lr\space thatch/.code          = \pingu@color{horse\@lr @thatch}{##1},%
    horse \@lr\space thatch draw/.code     = \pingu@color{horse\@lr @thatch@draw}{##1},%
    horse \@lr\space tail/.code            = \pingu@color{horse\@lr @tail}{##1},%
    horse \@lr\space tail draw/.code       = \pingu@color{horse\@lr @tail@draw}{##1},%
    horse \@lr\space eyes/.code            = \pingu@color{horse\@lr @eyes}{##1},%
    horse \@lr\space eye/.forward to       = /pingu/horse \@lr\space eyes,%
    horse \@lr\space mouth/.code           = \pingu@color{horse\@lr @mouth}{##1},%
    horse \@lr\space nose/.code            = \pingu@color{horse\@lr @nose}{##1},%
    horse \@lr\space ears/.code            = \pingu@color{horse\@lr @ears}{##1},%
    horse \@lr\space base/.code            = \pingu@color{horse\@lr @base}{##1},%
    horse \@lr\space base draw/.code       = \pingu@color{horse\@lr @base@draw}{##1},%
    horse \@lr\space base shade/.code      = \pingu@color{horse\@lr @base@shade}{##1},%
    horse \@lr\space base shade draw/.code = \pingu@color{horse\@lr @base@shade@draw}{##1},%
    horse \@lr\space xshift/.code          = \@namedef{pingu@x@horse\@lr @xshift}{##1},
    horse \@lr\space yshift/.code          = \@namedef{pingu@x@horse\@lr @yshift}{##1},
    horse \@lr\space on base/.style        ={/pingu/horse \@lr\space yshift=4cm},
}{horse \@lr\space draw=\csname pingu@color@horse\@lr\endcsname!80!pingu@black,horse \@lr\space mane=\csname pingu@color@horse\@lr\endcsname!86!pingu@white,horse \@lr\space mane draw=\csname pingu@color@horse\@lr @mane\endcsname!80!pingu@black,horse \@lr\space eyes=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space mouth=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space nose=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space ears=\csname pingu@color@horse\@lr\endcsname,horse \@lr\space thatch=\csname pingu@color@horse\@lr @mane\endcsname,horse \@lr\space thatch draw=\csname pingu@color@horse\@lr @thatch\endcsname!80!pingu@black,horse \@lr\space tail=\csname pingu@color@horse\@lr @mane\endcsname,horse \@lr\space tail draw=\csname pingu@color@horse\@lr @tail\endcsname!80!pingu@black,horse \@lr\space has base=false,horse \@lr\space base=lightgray!90!black,horse \@lr\space base draw=\csname pingu@color@horse\@lr @base\endcsname!91!pingu@black,horse \@lr\space base shade=lightgray!80!black,horse \@lr\space base shade draw=\csname pingu@color@horse\@lr @base@shade\endcsname!91!pingu@black,horse \@lr\space xshift=0pt,horse \@lr\space yshift=0pt,horse \@lr\space flip=\ifx\@lr\pingu@str@wing@left true\else false\fi}

\def\pingu@draw@wi@horse#1{%
    \pingu@setup@wing{horse}{#1}%
\scope[scale=\pingu@@horse@scale,every path/.append style={line cap=round, line join=round},shift=(\pingu@name-wing-#1),rotate around={\@angle-5:(\pingu@name-wing-#1)}]
\csname if@pingu@x@horse@#1@flip@\endcsname
\scope[xshift=-4cm-\csname pingu@x@horse#1@xshift\endcsname,yshift=-42mm+\csname pingu@x@horse#1@yshift\endcsname]
\else
\scope[xshift=4cm+\csname pingu@x@horse#1@xshift\endcsname,yshift=-42mm+\csname pingu@x@horse#1@yshift\endcsname,xscale=-1]
\fi
    \pingu@@drawer@horse{#1}
    % hoof
    % \pingu@block[draw=\csname pingu@color@horse#1@base@shade@draw\endcsname,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@base@shade\endcsname} (@hooffront) to[bend left=2] ++(.355*.65,-.565*.65) to[bend left=15] ++(-.395,-.075) to[bend left=10] ++(-.293,.105) to[bend left=9] ++(.06,.3) to[bend left=5] cycle;
\endscope\endscope
}
% todo: make statue extra
% todo: make horse hat