Skip to content

Commit

Permalink
Merge pull request #203 from EagleoutIce/202-hammer
Browse files Browse the repository at this point in the history
202 hammer
  • Loading branch information
EagleoutIce authored Nov 26, 2022
2 parents 72f8fdd + 18a576c commit dc51347
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 3 deletions.
147 changes: 147 additions & 0 deletions doc/tikzpingus-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4876,6 +4876,153 @@ \subsubsection{The staff}
\end{tcblisting}
\endsubkeyexplain

\subsubsection{The hammer}

\showkeyexplain{hammer left}{color}{pingu@silver}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left=green]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain

\subkeyexplain{hammer left}{hammer left handle length}{length}{\pingu@hammer@left@length}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left handle length=20mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left handle shift}{length}{\pingu@hammer@left@shift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left handle shift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left width}{length}{\pingu@hammer@left@width}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left width=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left height}{length}{\pingu@hammer@left@height}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left height=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left xshift}{length}{\pingu@hammer@left@xshift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left xshift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left yshift}{length}{\pingu@hammer@left@yshift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left yshift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer left}{hammer left handle}{color}{\pingu@color@hammer@left@handle}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left, hammer left handle=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\keyexplain{hammer left with knob}{color}{pingu@silver}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer left=green]
\end{tikzpicture}
\end{tcblisting}
\endkeyexplain

\showkeyexplain{hammer right}{color}{pingu@silver}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right=green]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain

\subkeyexplain{hammer right}{hammer right handle length}{length}{\pingu@hammer@right@length}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right handle length=20mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right handle shift}{length}{\pingu@hammer@right@shift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right handle shift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right width}{length}{\pingu@hammer@right@width}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right width=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right height}{length}{\pingu@hammer@right@height}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right height=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right xshift}{length}{\pingu@hammer@right@xshift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right xshift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right yshift}{length}{\pingu@hammer@right@yshift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right yshift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{hammer right}{hammer right handle}{color}{\pingu@color@hammer@right@handle}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right, hammer right handle=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\keyexplain{hammer right with knob}{color}{pingu@silver}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[hammer right=green]
\end{tikzpicture}
\end{tcblisting}
\endkeyexplain


\subsubsection{The laptop}

\showkeyexplain{laptop left}{color}{gray!80!pingu@white}
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

\begin{document}
\begin{preview}
\tikz{\pingu[eyes critical,wings shock,glasses round]}
\tikz{\pingu[hammer left, hammer right with knob]}
\end{preview}
\end{document}
24 changes: 23 additions & 1 deletion tex/tikzpingus-fun.lib.tex
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,26 @@
\pingu@block{\pingu@color@jackolantern@stalk} ([yshift=-.5*\pingu@x@jackolantern@outline@w]@pksl) to[bend left=3] ([yshift=-.5*\pingu@x@jackolantern@outline@w]@pksr) to[bend right=8] ++(.85mm,2mm) -- ++(.65mm,0) coordinate[pos=.5] (@pkc) to[bend right=3] cycle;
\pingu@block{\pingu@color@jackolantern@stalk@top} (@pkc) ellipse[x radius=.65mm/2, y radius=.085mm];
\endscope
}
}

\pingu@create@wing@extra{hammer}{%
hammer \@lr/.code = {\pingu@set@extra{hammer\@lr}{true}\pingu@color{hammer\@lr}{##1}},
hammer \@lr/.default = pingu@silver,
hammer \@lr\space handle length/.code = \expandafter\def\csname pingu@hammer@\@lr @length\endcsname{##1},
hammer \@lr\space handle shift/.code = \expandafter\def\csname pingu@hammer@\@lr @shift\endcsname{##1},
hammer \@lr\space width/.code = \expandafter\def\csname pingu@hammer@\@lr @width\endcsname{##1},
hammer \@lr\space height/.code = \expandafter\def\csname pingu@hammer@\@lr @height\endcsname{##1},
hammer \@lr\space xshift/.code = \expandafter\def\csname pingu@hammer@\@lr @xshift\endcsname{##1},
hammer \@lr\space yshift/.code = \expandafter\def\csname pingu@hammer@\@lr @yshift\endcsname{##1},
hammer \@lr\space handle/.code = \pingu@color{hammer@\@lr @handle}{##1},%
hammer \@lr\space with knob/.style = {hammer \@lr=##1, hammer \@lr\space handle length=\dimexpr9mm+\csname pingu@hammer@\@lr @height\endcsname+.5mm,hammer \@lr\space yshift=\dimexpr-.5mm-\csname pingu@hammer@\@lr @height\endcsname},
hammer \@lr\space with knob/.default = pingu@silver
}{hammer \@lr\space handle length=9mm, hammer \@lr\space handle=pingu@bronze, hammer \@lr\space handle shift=-4mm, hammer \@lr\space width=7mm,hammer \@lr\space height=3.5mm, hammer \@lr\space xshift=-0.5*\csname pingu@hammer@\@lr @width\endcsname,hammer \@lr\space yshift=-1mm}
\def\pingu@draw@wi@hammer#1{%
\pingu@setup@wing{hammer}{#1}%
\scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
% \csname pingu@color@hammer#1\endcsname
\pingu@block{\csname pingu@color@hammer@#1@handle\endcsname}(\pingu@name-wing-#1)++(\@sidesign*-.2mm,\csname pingu@hammer@#1@shift\endcsname) -- ++(0,\csname pingu@hammer@#1@length\endcsname) arc(180:0:\@sidesign*.4mm and .3mm) coordinate[pos=.5] (\pingu@name-hammer-#1-top) -- ++(0,-\csname pingu@hammer@#1@length\endcsname) arc(360:180:\@sidesign*.4mm and .3mm) -- cycle;
\pingu@block[rounded corners=2pt]{\csname pingu@color@hammer#1\endcsname} (\pingu@name-hammer-#1-top)++(\csname pingu@hammer@#1@xshift\endcsname,\csname pingu@hammer@#1@yshift\endcsname) rectangle ++(\csname pingu@hammer@#1@width\endcsname,\csname pingu@hammer@#1@height\endcsname);
\endscope
}
2 changes: 1 addition & 1 deletion tex/tikzpingus.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ coordinate[pos=\pinguanglehl] (\pingu@name-head-left);
\pingu@dummy@lib{cloak}{cloak,cape}
\pingu@dummy@lib{christmas}{santa hat,santa beard}
\pingu@dummy@lib{science-fiction}{lightsaber left,lightsaber right}
\pingu@dummy@lib{fun}{cake-hat,pumpkin-hat,lollipop left,lollipop right,vampire teeth,broom left,broom right,jack o lantern,jack o lantern helmet}
\pingu@dummy@lib{fun}{cake-hat,pumpkin-hat,lollipop left,lollipop right,vampire teeth,broom left,broom right,jack o lantern,jack o lantern helmet,hammer left, hammer right}
\pingu@dummy@lib{technology}{vr-headset,headphone,vr-controller left,vr-controller right,laptop left,laptop right}
\pingu@dummy@lib{flags}{flag left,flag right}
\pingu@dummy@lib{hats}{strawhat,hat,cap,construction helmet,conical hat,witch hat}
Expand Down

0 comments on commit dc51347

Please sign in to comment.