summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzpingus/tikzpingus-glasses.lib.tex
blob: 609adcb71dcdda61bc2346dbd18932d78443f847 (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
% Florian Sihler, 2022
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\pingu@create@extra{glasses}{%
    glasses/.code               = \pingu@set@extra{glasses}{true}\pingu@color{glasses}{#1},
    glasses/.default            = pingu@black,
    glasses left fill/.code     = \pingu@color{glasses@fill@l}{#1},
    glasses right fill/.code    = \pingu@color{glasses@fill@r}{#1},
    glasses left opacity/.code  = \def\pingu@x@glasses@op@l{#1},
    glasses right opacity/.code = \def\pingu@x@glasses@op@r{#1},
    glasses fill/.style         = {/pingu/glasses left fill=#1, /pingu/glasses right fill=#1},
    glasses opacity/.style      = {/pingu/glasses left opacity=#1, /pingu/glasses right opacity=#1},
    glasses line width/.code    = \def\pingu@x@glasses@lw{#1},
    sunglasses/.forward to      = /pingu/sun glasses,
    glasses bend left/.code     = \def\pingu@x@glasses@bend@l{#1},
    glasses bend right/.code    = \def\pingu@x@glasses@bend@r{#1},
    glasses bend/.style         = {/pingu/glasses bend left=#1,/pingu/glasses bend right=#1},
    sun glasses/.style          = {/pingu/glasses, /pingu/glasses fill=#1},
    sun glasses/.default        = pingu@black,
}{glasses line width=1.125\p@,glasses fill=\@pingu@none,glasses opacity=.825,glasses bend left=32.5,glasses bend right=32.5}

\def\pingu@draw@ea@glasses{% fact: 1.33; modified first shift and ht
    \pingu@block[opacity=\pingu@x@glasses@op@l]{\pingu@color@glasses@fill@l} (\pingu@name-eye-left)++(-2.66mm,1.75mm) to[bend left=8] ++(5.586mm,0) to[out=-80,in=70] ++(-.266mm,-3.6mm) to[bend left=\pingu@x@glasses@bend@l] ++(-4.8545mm,\z@) to[out=135,in=-90] ++(-1.064mm,3.5mm) -- cycle;
    \pingu@block[opacity=\pingu@x@glasses@op@r]{\pingu@color@glasses@fill@r} (\pingu@name-eye-right)++(2.66mm,1.75mm) to[bend right=8] ++(-5.586mm,0) to[out=-100,in=110] ++(.266mm,-3.6mm) to[bend right=\pingu@x@glasses@bend@r] ++(4.8545mm,\z@) to[out=45,in=-90] ++(1.064mm,3.5mm) -- cycle;
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses} [rounded corners=.25mm](\pingu@name-eye-left)++(-2.66mm,1.75mm) coordinate (\pingu@name-glasses-left-mid) to[bend left=8] ++(5.586mm,0) coordinate (\pingu@name-glasses-left-outer) to[out=-80,in=70] ++(-.266mm,-3.6mm) to[bend left=\pingu@x@glasses@bend@l] ++(-4.8545mm,\z@) to[out=135,in=-90] coordinate[pos=.9] (\pingu@name-glasses-left-mid-b) ++(-1.064mm,3.5mm) -- cycle;
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses} [rounded corners=.25mm] (\pingu@name-eye-right)++(2.66mm,1.75mm) coordinate (\pingu@name-glasses-right-mid) to[bend right=8] ++(-5.586mm,0) coordinate (\pingu@name-glasses-right-outer) to[out=-100,in=110] ++(.266mm,-3.6mm) to[bend right=\pingu@x@glasses@bend@r] ++(4.8545mm,\z@) to[out=45,in=-90] coordinate[pos=.9] (\pingu@name-glasses-right-mid-b) ++(1.064mm,3.5mm) -- cycle;
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses} (\pingu@name-glasses-right-mid) to[bend right=10] (\pingu@name-glasses-left-mid);
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses} (\pingu@name-glasses-right-mid-b) to[bend left=20] (\pingu@name-glasses-left-mid-b);
    \scope
    \clip[use path=\pingu@upperpingu];
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses}
    (\pingu@name-glasses-right-mid) to[bend right=8] ++(-5.586mm,0) -- ++(-5mm,.5mm);
    \pingu@draw[line width=\pingu@x@glasses@lw]{\pingu@color@glasses}
    (\pingu@name-glasses-left-mid) to[bend left=8] ++(5.586mm,0) -- ++(5mm,.5mm);
    \endscope
}
\pingu@create@extra{glassesround}{%
    glasses round/.code               = \pingu@set@extra{glassesround}{true}\pingu@color{glassesround}{#1},
    glasses round/.default            = pingu@black,
    glasses round left fill/.code     = \pingu@color{glassesround@fill@l}{#1},
    glasses round right fill/.code    = \pingu@color{glassesround@fill@r}{#1},
    glasses round fill/.style         = {/pingu/glasses round left fill=#1, /pingu/glasses round right fill=#1},
    glasses round left opacity/.code  = \def\pingu@x@glassesround@op@l{#1},
    glasses round right opacity/.code = \def\pingu@x@glassesround@op@r{#1},
    glasses round opacity/.style      = {/pingu/glasses round left opacity=#1, /pingu/glasses round right opacity=#1},
    glasses round left radius/.code  = \def\pingu@x@glassesround@r@l{#1},
    glasses round right radius/.code = \def\pingu@x@glassesround@r@r{#1},
    glasses round radius/.style      = {/pingu/glasses round left radius=#1, /pingu/glasses round right radius=#1},
    glasses round line width/.code    = \def\pingu@x@glassesround@lw{#1},
    sunglasses round/.forward to      = /pingu/sun glasses round,
    sun glasses round/.style          = {/pingu/glasses round, /pingu/glasses round fill=#1},
    sun glasses round/.default        = pingu@black,
    % todo: width/radius allow for different
}{glasses round line width=.75\p@,glasses round fill=\@pingu@none,glasses round opacity=.825,glasses round radius=3.15mm}
\def\pingu@draw@ea@glassesround{% fact: 1.33; modified first shift and ht
    \pingu@block[opacity=\pingu@x@glassesround@op@l]{\pingu@color@glassesround@fill@l} (\pingu@name-eye-left) circle [radius=\pingu@x@glassesround@r@l];
    \pingu@block[opacity=\pingu@x@glassesround@op@r]{\pingu@color@glassesround@fill@r} (\pingu@name-eye-right) circle [radius=\pingu@x@glassesround@r@r];
    \pingu@draw[line width=\pingu@x@glassesround@lw]{\pingu@color@glassesround} [rounded corners=.25mm](\pingu@name-eye-left) ++(150:\pingu@x@glassesround@r@l) coordinate (\pingu@name-glassesround-left-mid) arc (150:510:\pingu@x@glassesround@r@l);
    \pingu@draw[line width=\pingu@x@glassesround@lw]{\pingu@color@glassesround} [rounded corners=.25mm] (\pingu@name-eye-right) ++(30:\pingu@x@glassesround@r@r) coordinate (\pingu@name-glassesround-right-mid) arc (30:390:\pingu@x@glassesround@r@r);
    \pingu@draw[line width=\pingu@x@glassesround@lw]{\pingu@color@glassesround} (\pingu@name-glassesround-left-mid) to[bend right=30] (\pingu@name-glassesround-right-mid);
    \scope
    \clip[use path=\pingu@upperpingu];
    \pingu@draw[line width=\pingu@x@glassesround@lw]{\pingu@color@glassesround}
     (\pingu@name-glassesround-right-mid) arc(30:150:\pingu@x@glassesround@r@l) -- ++(-5mm,.65mm);
     \pingu@draw[line width=\pingu@x@glassesround@lw]{\pingu@color@glassesround}
     (\pingu@name-glassesround-left-mid) arc(150:30:\pingu@x@glassesround@r@r) -- ++(5mm,.65mm);
    \endscope
}
\pingu@create@extra{monocleleft}{%
    monocle left/.code              = \pingu@set@extra{monocleleft}{true}\pingu@color{monocleleft}{#1},
    monocle left/.default           = pingu@black,
    monocle left glass/.code        = \pingu@color{monocleleft@glass}{#1},
    monocle left fill/.forward to   = /pingu/monocle left glass,
    monocle left opacity/.code      = \def\pingu@x@monocleleft@opacity{#1},
    monocle left fill opacity/.forward to   = /pingu/monocle left opacity,
    monocle left string/.code       = \pingu@color{monocleleft@string}{#1},
    monocle left string length/.code= \def\pingu@x@monocleleft@string@l{#1},
    monocle left blob/.code         = \pingu@color{monocleleft@blob}{#1},
}{monocle left glass=pingu@blue,monocle left opacity=.155,monocle left string=\pingu@color@monocleleft,monocle left blob=\pingu@color@monocleleft,monocle left string length=5.55mm}

\def\pingu@draw@eb@monocle@l{%
    \pingu@block[/pingu/glow,opacity=\pingu@x@monocleleft@opacity]{\pingu@color@monocleleft@glass} (\pingu@name-eye-left) circle[radius=2mm];
    \pingu@draw[thin]{\pingu@color@monocleleft@string} (\pingu@name-eye-left)++(2mm,0)
    to[out=-75,in=100] ++(0,-\pingu@x@monocleleft@string@l);
    \pingu@block{\pingu@color@monocleleft@blob} (\pingu@name-eye-left)++(2mm,-\pingu@x@monocleleft@string@l) circle [radius=.65\p@];
    \pingu@draw[semithick]{\pingu@color@monocleleft} (\pingu@name-eye-left) circle[radius=2mm];
}
\pingu@create@extra{monocleright}{%
    monocle right/.code              = \pingu@set@extra{monocleright}{true}\pingu@color{monocleright}{#1},
    monocle right/.default           = pingu@black,
    monocle right glass/.code        = \pingu@color{monocleright@glass}{#1},
    monocle right fill/.forward to   = /pingu/monocle right glass,
    monocle right opacity/.code      = \def\pingu@x@monocleright@opacity{#1},
    monocle right fill opacity/.forward to   = /pingu/monocle right opacity,
    monocle right string/.code       = \pingu@color{monocleright@string}{#1},
    monocle right string length/.code= \def\pingu@x@monocleright@string@r{#1},
    monocle right blob/.code         = \pingu@color{monocleright@blob}{#1},
}{monocle right glass=pingu@blue,monocle right opacity=.155,monocle right string=\pingu@color@monocleright,monocle right blob=\pingu@color@monocleright,monocle right string length=5.55mm}
\def\pingu@draw@eb@monocle@r{%
    \pingu@block[/pingu/glow,opacity=\pingu@x@monocleright@opacity]{\pingu@color@monocleright@glass} (\pingu@name-eye-right) circle[radius=2mm];
    \pingu@draw[thin]{\pingu@color@monocleright@string} (\pingu@name-eye-right)++(-2mm,0)
    to[out=-105,in=80] ++(0,-\pingu@x@monocleright@string@r);
    \pingu@block{\pingu@color@monocleright@blob} (\pingu@name-eye-right)++(-2mm,-\pingu@x@monocleright@string@r) circle [radius=.65\p@];
    \pingu@draw[semithick]{\pingu@color@monocleright} (\pingu@name-eye-right) circle[radius=2mm];
}