The TikZpingus package
Internals
C.7 The Body Type¶
C.7.1 Important Commands¶
\pingu@w@half¶
This dimension holds a hardcoded value defining the half width of the penguin. Its default value is 26.67445pt.
\pingu@side@h@half¶
This dimension holds a hardcoded value defining the half height of the lower part of the penguin. Its default value is 36.27708pt. See \pingu@head@h@half for the additional head-height.
\pingu@head@h@half¶
This dimension holds a hardcoded value defining the half height of the upper (head) part of the penguin. Its default value is 24.00684pt.
\pingu@bend¶
This dimension holds a hardcoded value used as a basis for bend lines. Its default value is 3.55658pt. It may be removed in the future (or replaced by an option).
\pingu@lower@off¶
This dimension holds a hardcoded value used to offset the white inner parts of the penguin (for the bottom part). Its default value is 7.11317pt. It may be removed in the future (or replaced by an option).
\pingu@outer@off¶
This dimension holds a hardcoded value used to offset the lower part of the basic penguin. Its default value is 7.11317pt. It may be removed in the future (or replaced by an option).
\pingu@foot@outer@w¶
This dimension holds a hardcoded value defining the width of the outer feet. Its default value is 12.80373pt. It may be removed in the future (or replaced by an option).
\pingu@foot@outer@h¶
This dimension holds a hardcoded value defining the height of the outer feet. Its default value is 7.11317pt. It may be removed in the future (or replaced by an option).
\pingu@foot@inner@w¶
This dimension holds a hardcoded value defining the width of the inner feet. Its default value is 15.6491pt. It may be removed in the future (or replaced by an option).
\pingu@foot@inner@h¶
This dimension holds a hardcoded value defining the height of the inner feet. Its default value is 3.27222pt. It may be removed in the future (or replaced by an option).
\pingu@headcon@x¶
This dimension holds a hardcoded value defining the x-position offsetting the connection point of the penguin head. Its default value is 11.20335pt. It may be removed in the future (or replaced by an option).
\pingu@headcon@y¶
This dimension holds a hardcoded value defining the y-position offsetting the connection point of the penguin head. Its default value is 13.29729pt. It may be removed in the future (or replaced by an option).
C.7.2 The Code¶
The body of the penguin is controlled by one selection. There are a lot of coordinates to be created by this command (as presented in Section 2.1). Furthermore, it must save some paths (\pingu@lowerpingu, \pingu@upperpingu and \pingu@whitepingu). Therefore, it is recommended, that you create a new one by first copying an existing definition. Due to its length, the none-version of \pingu@create@selection uses \pingu@x@bodytype@none as a helper:
This code, defines three commands: \pingu@bodytype@select, \pingu@bodytype@add, \@pingu@drawer@bodytype@.
The macro \pingu@x@bodytype@none is defined as follows:
\def\pingu@x@bodytype@none{%
% set the lower half
\path[save path=\pingu@lowerpingu] (0,\pingu@outer@off)
% left side
\pingu@bend@body{-\pingu@side@h@half-\pingu@outer@off}
coordinate[pos=.775] (\pingu@name-waist-right)
% feety stuff
\pingu@arc@aa
coordinate (\pingu@name-foot-right)
\pingu@arc@ab
coordinate (\pingu@name-bottom-center)
\pingu@arc@ac
coordinate (\pingu@name-foot-left)
\pingu@arc@ad
% right side
\pingu@bend@body{\pingu@side@h@half+\pingu@outer@off}
coordinate[pos=.225] (\pingu@name-waist-left)
% switch to left
coordinate (\pingu@name-wings-side-left)
-- (0,\pingu@outer@off)
coordinate[pos=.5] (\pingu@name-head-center)
coordinate (\pingu@name-wings-side-right)
-- cycle;
% set the upper half
\path[save path=\pingu@upperpingu] (\pingu@name-head-center)
++(0,\pingu@head@h@half)
coordinate (\pingu@name-head-top)
arc(90:450:\pingu@w@half{} and \pingu@head@h@half)
coordinate[pos=\pinguanglehr] (\pingu@name-head-right)
coordinate[pos=\pinguanglehl] (\pingu@name-head-left);
\coordinate (\pingu@name-belly-back) at (\pingu@w@half,-1cm);
\coordinate (\pingu@name-belly-center) at (\pingu@w@half,-.68\pingu@side@h@half);
% set the white above
\path[save path=\pingu@whitepingu] (\pingu@name-belly-back)
++(-\pingu@w@half+\pingu@one,\pingu@lower@off)
\pingu@bend@belly{1.05cm-\pingu@side@h@half-\pingu@lower@off}
\pingu@arc@af
\pingu@arc@ag
\pingu@arc@ah
\pingu@arc@ai
\pingu@bend@belly{\pingu@side@h@half-1.05cm+\pingu@lower@off}
\pingu@arc@aj
-- cycle;
\coordinate (\pingu@name-eye-back-right)
at ([xshift=-.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center);
\coordinate (\pingu@name-eye-back-left)
at ([xshift=.275cm,yshift=.25cm-\pingu@outer@off]\pingu@name-head-center);
\coordinate (\pingu@name-head-back-con-right)
at ([xshift=-\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-right);
\coordinate (\pingu@name-head-back-con-left)
at ([xshift=\pingu@headcon@x,yshift=-\pingu@headcon@y]\pingu@name-eye-back-left);
}
Important:
Please note, that when writing the initial penguin, I did not intend to allow additional body shapes. Therefore, most of the defaults and “globals” must be defined here (alongside a lot of hardcoding).
Within the initialization of all penguin options, we define the main colors:
body type/.code = \pingu@bodytype@select{#1},
body main/.code = \pingu@color{body@main}{#1},
body head/.code = \pingu@color{body@head}{#1},
body/.style = {/pingu/body main={#1}, /pingu/body head={#1}},
body front/.code = \pingu@color{body@front}{#1},
With this, the body has three colors to work with: \pingu@color@body@main, \pingu@color@body@head, and \pingu@color@body@front.