summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-07-21 03:00:45 +0000
committerNorbert Preining <norbert@preining.info>2022-07-21 03:00:45 +0000
commit5cf5182b44c08dfb2bc977ce5aa5ca6d03b36923 (patch)
treeb32d29c9fb1289ccc994ee099b27c4a45b621a0a /graphics/pgf/contrib
parent2773132ea593028dafe764f7560fd94ecb827d3d (diff)
CTAN sync 202207210300
Diffstat (limited to 'graphics/pgf/contrib')
-rw-r--r--graphics/pgf/contrib/bodeplot/README.md12
-rw-r--r--graphics/pgf/contrib/bodeplot/bodeplot.dtx384
-rw-r--r--graphics/pgf/contrib/bodeplot/bodeplot.pdfbin992859 -> 1007326 bytes
-rw-r--r--graphics/pgf/contrib/tikzfill/CHANGES.md23
-rw-r--r--graphics/pgf/contrib/tikzfill/README.md56
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill-common.sty56
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill-doc.sty130
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.hexagon.sty24
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.image.sty24
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.pdfbin0 -> 721265 bytes
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.rhombus.sty24
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.sty24
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzfill.tex1385
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzlibraryfill.hexagon.code.tex315
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzlibraryfill.image.code.tex400
-rw-r--r--graphics/pgf/contrib/tikzfill/tikzlibraryfill.rhombus.code.tex159
16 files changed, 2844 insertions, 172 deletions
diff --git a/graphics/pgf/contrib/bodeplot/README.md b/graphics/pgf/contrib/bodeplot/README.md
index 23733a484e..25b8d7e1dd 100644
--- a/graphics/pgf/contrib/bodeplot/README.md
+++ b/graphics/pgf/contrib/bodeplot/README.md
@@ -5,6 +5,16 @@ Inspired by the `bodegraph` package.
*Version 1.0.8 and newer store `gnuplot` temporary files in the working directory. Use class option `declutter` to restore pre-v1.0.8 behavior. Option `declutter` can cause errors if used with a `tikzexternalize` prefix.*
+Compilation instructions:
+1) `latex bodeplot.ins` to generate `bodeplot.sty`
+2) To compile documentation (needs `gnuplot` on system PATH):
+```
+pdflatex bodeplot.dtx --shell-escape
+makeindex -s gind.ist bodeplot.idx
+makeindex -s gglo.ist -o bodeplot.gls bodeplot.glo
+pdflatex bodeplot.dtx --shell-escape
+pdflatex bodeplot.dtx --shell-escape
+```
Added functionality:
- New `\BodeZPK` and `\BodeTF` commands to generate Bode plots of any transfer function given either poles, zeros, gain, and delay, or numerator and denominator coefficients and delay
- Support for unstable poles and zeros.
@@ -42,4 +52,4 @@ Other new environments and associated commands:
- `\addNyquistZPKPlot[plot-options]{z/{zeros},p/{poles},k/gain,d/delay}`
- `\addNyquistTFPlot[plot-options]{num/{coeff},den/{coeff},d/delay}`
-Limitation: Phase plots from TF commands are wrapped between 0 and 360 degrees. \ No newline at end of file
+Limitation: Nichols charts from TF commands are wrapped between 0 and 360 degrees.
diff --git a/graphics/pgf/contrib/bodeplot/bodeplot.dtx b/graphics/pgf/contrib/bodeplot/bodeplot.dtx
index 10cc1700aa..a5cdfbf6db 100644
--- a/graphics/pgf/contrib/bodeplot/bodeplot.dtx
+++ b/graphics/pgf/contrib/bodeplot/bodeplot.dtx
@@ -18,7 +18,6 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2006/05/20]
%<package>\ProvidesPackage{bodeplot}
-%<package>\RequirePackage{tikz}
%<package>\RequirePackage{pdftexcmds}
%<package>\RequirePackage{ifplatform}
%<package>\RequirePackage{pgfplots}
@@ -55,6 +54,7 @@
\geometry{lmargin=2in,rmargin=1in,tmargin=1in,bmargin=1in}
\usetikzlibrary{decorations.markings,arrows.meta,spy,backgrounds}
\usepackage[nottoc]{tocbibind}
+\sloppy
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -66,7 +66,7 @@
%</driver>
% \fi
%
-% \CheckSum{1375}
+% \CheckSum{1404}
%
% \changes{v1.0}{2021/10/25}{Initial release}
% \changes{v1.0.4}{2021/11/05}{Fixed unintended optional argument macro expansion}
@@ -74,13 +74,12 @@
% \changes{v1.0.7}{2021/12/02}{Removed unnecessary semicolons}
% \changes{v1.0.7}{2022/01/18}{Updated documentation}
% \changes{v1.0.8}{2022/07/06}{Added a new class option `declutter'}
+% \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}
%
% \GetFileInfo{bodeplot.sty}
% \DoNotIndex{\newcommand,\xdef,\gdef,\def,\edef,\addplot,\approx,\arabic,\opt,\typ,\obj,\else,\if@pgfarg,\fi,\begin,\end,\feature,\footnotesize,\draw,\detokenize,\DeclareOption,\foreach,\ifdim,\ifodd,\Im,\Re,\let,\newif,\nextgroupplot,\noexpand,\expandafter,\unexpanded,\PackageError,\PackageWarning,\relax,\RequirePackage,\tikzset,\pgfmathsetmacro,\pgfmathtruncatemacro,\ProcessOptions}
%
-% \title{The \textsf{bodeplot} package\thanks{This document
-% corresponds to \textsf{bodeplot}~v1.0.8,
-% dated July 06, 2022.}}
+% \title{The \textsf{bodeplot} package\thanks{This document corresponds to \textsf{bodeplot}~v1.1.0, dated July 20, 2022.}}
% \author{Rushikesh Kamalapurkar \\ \texttt{rlkamalapurkar@gmail.com}}
%
% \maketitle
@@ -88,14 +87,14 @@
% \clearpage
% \section{Introduction}
%
-% Generate Bode, Nyquist, and Nichols plots for transfer functions in the canonical (TF) form \begin{equation}G(s) = e^{-Ts}\frac{b_ms^m+\cdots+b_1s+b_0}{a_ns^n+\cdots+a_1s+a_0}\label{eq:TF}\end{equation} and the zero-pole-gain (ZPK) form \begin{equation}G(s) = Ke^{-Ts}\frac{(s-z_1)(s-z_2)\cdots(s-z_m)}{(s-p_1)(s-p_2)\cdots(s-p_n)}.\label{eq:ZPK}\end{equation} In the equations above, $b_m,\cdots,b_0$ and $a_n,\cdots,a_0$ are real coefficients, $T\geq 0$ is the loop delay, $z_1,\cdots,z_m$ and $p_1,\cdots,p_n$ are complex zeros and poles of the transfer function, respectively, and $K\in \Re$ is the loop gain. For transfer functions in the ZPK format in (\ref{eq:ZPK}) \emph{with zero delay}, this package also supports linear and asymptotic approximation of Bode plots.
+% Generate Bode, Nyquist, and Nichols plots for transfer functions in the canonical (TF) form \begin{equation}G(s) = e^{-Ts}\frac{b_ms^m+\cdots+b_1s+b_0}{a_ns^n+\cdots+a_1s+a_0}\label{eq:TF}\end{equation} and the zero-pole-gain (ZPK) form \begin{equation}G(s) = Ke^{-Ts}\frac{(s-z_1)(s-z_2)\cdots(s-z_m)}{(s-p_1)(s-p_2)\cdots(s-p_n)}.\label{eq:ZPK}\end{equation} In the equations above, $b_m,\cdots,b_0$ and $a_n,\cdots,a_0$ are real coefficients, $T\geq 0$ is the loop delay, $z_1,\cdots,z_m$ and $p_1,\cdots,p_n$ are complex zeros and poles of the transfer function, respectively, and $K\in \Re$ is the loop gain. For transfer functions in the ZPK format in (\ref{eq:ZPK}) \emph{with zero delay}, this package also supports linear and asymptotic approximation of Bode plots. By default, all phase plots use degrees as units. Use the |rad| package option to generate plots in radians.
% \subsection{External Dependencies}
-% By default, the package uses |gnuplot| to do all the computations. If |gnuplot| is not available, the |pgf| package option can be used to do the calculations using the native |pgf| math engine. Compilation using the |pgf| math engine is typically slower, but the end result should be the identical.
+% By default, the package uses |gnuplot| to do all the computations. If |gnuplot| is not available, the |pgf| package option can be used to do the calculations using the native |pgf| math engine. Compilation using the |pgf| math engine is typically slower, but the end result should be the identical (other than phase wrapping in the TF format, see limitations below).
%\subsection{Directory Structure}
% Since version 1.0.8, the |bodeplot| package places all |gnuplot| temporary files in the working directory. The package option |declutter| restores the original behavior where the temporary files are placed in a folder called |gnuplot|.
% \subsection{Limitations}
% \begin{itemize}
-% \item In TF form, the phase angles are always between 0 and 360$^\circ$. As such, the Bode phase plots and the Nyquist and Nichols plots will have phase wrapping discontinuities. I do not know how this can be rectified, pull requests are welcome!
+% \item When plotting Nichols charts in TF form, the phase angles are wrapped between 0 and 360$^\circ$. As such, the Nichols charts will have phase wrapping discontinuities. Phase wrapping in Bode plots was fixed in v1.1.0 using |gnuplot|. In |pgf| mode, Bode phase plots, plotted using the TF form, will also show phase wrapping discontinuities.
% \item Use of the |declutter| option with other directory management tools such as a |tikzexternalize| prefix is not recommended.
% \end{itemize}
% \clearpage
@@ -123,7 +122,7 @@
\hrulefill
-Bode plot in TF format with arrow decoration, transport delay, and color customization (note the phase wrapping)
+Bode plot in TF format with arrow decoration, transport delay, and color customization (the phase plot will show wrapping if the |pgf| package option is used)
\begin{LTXexample}[pos=r,width=0.5\textwidth]
\BodeTF[%
samples=1000,
@@ -188,10 +187,8 @@ Individual gain and phase plots with more customization
\begin{minipage}[t]{0.45\textwidth}
\begin{LTXexample}[pos=t,width=\columnwidth]
-\begin{BodePlot}[%
- axes/{ylabel={Gain (dB)},
- ytick distance=40,
- height=2cm,
+\begin{BodeMagPlot}[%
+ axes/{height=2cm,
width=4cm}
]
{0.01}
@@ -207,13 +204,12 @@ Individual gain and phase plots with more customization
p/{{-0.5,-10},{-0.5,10}},
k/10
}
-\end{BodePlot}
+\end{BodeMagPlot}
\end{LTXexample}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\begin{LTXexample}[pos=t,width=\columnwidth]
-\begin{BodePlot}[%
- ylabel={Phase ($^{\circ}$)},
+\begin{BodePhPlot}[%
height=2cm,
width=4cm,
ytick distance=90
@@ -231,7 +227,7 @@ Individual gain and phase plots with more customization
p/{{-0.5,-10},{-0.5,10}},
k/10
}
-\end{BodePlot}
+\end{BodePhPlot}
\end{LTXexample}
\end{minipage}
@@ -243,20 +239,21 @@ Nichols chart
{%
z/{0,{-0.1,-0.5},{-0.1,0.5}},
p/{{-0.5,-10},{-0.5,10}},
- k/10
+ k/10,
+ d/0.01
}
{0.001}
-{100}
+{500}
\end{LTXexample}
\hrulefill
-Nichols chart in TF format
+Same Nichols chart in TF format (shows phase wrapping discontinuity)
\begin{LTXexample}[pos=r,hsep=20pt,width=0.5\textwidth]
\NicholsTF[samples=1000]
-{num/{10,2,2.6,0},den/{1,1,100.25}}
+{num/{10,2,2.6,0},den/{1,1,100.25},d/0.01}
{0.001}
-{100}
+{500}
\end{LTXexample}
\hrulefill
@@ -486,12 +483,12 @@ Nyquist plots with additional commands, using two different macros
% \end{center}
% \end{figure}
%
-% \DescribeEnv{BodePlot}
-% |\begin{BodePlot}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\
+% \DescribeEnv{BodeMagPlot}
+% |\begin{BodeMagPlot}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\
% \hspace*{3em}\marg{min-frequency}\marg{max-frequency}\\
% \hspace*{2em}|\addBode...|\\
-% \hspace*{1.5em}|\end{BodePlot}|\\
-% The |BodePlot| environment works in conjunction with the parametric function generator macros |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|. The optional argument is comprised of a comma separated list of tuples, either |obj/{opt}| or just |{opt}|. Each tuple passes options to different |pgfplots| macros that generate the axes and the plots according to:
+% \hspace*{1.5em}|\end{BodeMagPlot}|\\
+% The |BodeMagPlot| environment works in conjunction with the parametric function generator macros |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|, intended to be used for magnitude plots. The optional argument is comprised of a comma separated list of tuples, either |obj/{opt}| or just |{opt}|. Each tuple passes options to different |pgfplots| macros that generate the axes and the plots according to:
% \begin{itemize}
% \item Tuples of the form |obj/{opt}|:
% \begin{itemize}
@@ -503,6 +500,13 @@ Nyquist plots with additional commands, using two different macros
% \end{itemize}
% The frequency limits are translated to the x-axis limits and the domain of the |semilogaxis| environment. Example usage in the description of |\addBodeZPKPlots|, |\addBodeTFPlot|, and |\addBodeComponentPlot|.
%
+%\DescribeEnv{BodePhPlot}
+% |\begin{BodePhPlot}|\oarg{obj1/\marg{opt1},obj2/\marg{opt2},...}\\
+ % \hspace*{3em}\marg{min-frequency}\marg{max-frequency}\\
+ % \hspace*{2em}|\addBode...|\\
+ % \hspace*{1.5em}|\end{BodePhPlot}|\\
+% Intended to be used for phase plots, otherwise same as the |BodeMagPlot| environment
+%
% \DescribeMacro{\addBodeZPKPlots}
% |\addBodeZPKPlots| \oarg{approx1/\marg{opt1},approx2/\marg{opt2},...}\\
% \hspace*{2em}\marg{plot-type}\\
@@ -512,50 +516,44 @@ Nyquist plots with additional commands, using two different macros
%
% For example, given the transfer function in (\ref{eq:ZPKExample}), its linear, asymptotic, and true Bode plots can be superimposed using
%\begin{verbatim}
-%\begin{BodePlot}[ ylabel={Gain (dB)}, ytick distance=40,
-% height=2cm, width=4cm] {0.01} {100}
+%\begin{BodeMagPlot}[height=2cm,width=4cm] {0.01} {100}
% \addBodeZPKPlots[
% true/{black,thick},
% linear/{red,dashed,thick},
% asymptotic/{blue,dotted,thick}]
% {magnitude}
% {z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}
-%\end{BodePlot}
+%\end{BodeMagPlot}
%
-%\begin{BodePlot}[ylabel={Phase ($^{\circ}$)},
-% height=2cm, width=4cm, ytick distance=90] {0.01} {100}
+%\begin{BodePhPlot}[height=2cm, width=4cm, ytick distance=90] {0.01} {100}
% \addBodeZPKPlots[
% true/{black,thick},
% linear/{red,dashed,thick},
% asymptotic/{blue,dotted,thick}]
% {phase}
% {z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}
-%\end{BodePlot}
+%\end{BodePhPlot}
%\end{verbatim}
% \begin{figure}
% \begin{center}
-% \begin{BodePlot}[ ylabel={Gain (dB)}, ytick distance=40,
-% height=2cm, width=4cm] {0.01} {100}
-%
+% \begin{BodeMagPlot}[height=2cm,width=4cm]{0.01}{100}
% \addBodeZPKPlots[
% true/{black,thick},
% linear/{red,dashed,thick},
% asymptotic/{blue,dotted,thick}]
% {magnitude}
% {z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}
-% \end{BodePlot}
-% \begin{BodePlot}[ylabel={Phase ($^{\circ}$)},
-% height=2cm, width=4cm, ytick distance=90] {0.01} {100}
-%
+% \end{BodeMagPlot}
+% \begin{BodePhPlot}[height=2cm,width=4cm,ytick distance=90]{0.01}{100}
% \addBodeZPKPlots[
% true/{black,thick},
% linear/{red,dashed,thick},
% asymptotic/{blue,dotted,thick}]
% {phase}
% {z/{0,{-0.1,-0.5},{-0.1,0.5}},p/{{-0.5,-10},{-0.5,10}},k/10}
-% \end{BodePlot}
+% \end{BodePhPlot}
% \end{center}
-% \caption{\label{multiBodeZPK}Superimposed approximate and true Bode plots using the \texttt{BodePlot} environment and the \texttt{\textbackslash addBodeZPKPlots} macro.}
+% \caption{\label{multiBodeZPK}Superimposed approximate and true Bode plots using the \texttt{BodeMagPlot} and \texttt{BodePhPlot} environments and the \texttt{\textbackslash addBodeZPKPlots} macro.}
% \end{figure}
% which generates the plot in Figure \ref{multiBodeZPK}.
%
@@ -584,7 +582,7 @@ Nyquist plots with additional commands, using two different macros
% \end{itemize}
% All 20 of the macros defined by combinations of |Type|, |Feature|, and |Approx|, and any |gnuplot| (or |pgfplot| if the |pgf| class option is loaded) compatible function of the 20 macros can be used as |plot-command| in the |addBodeComponentPlot| macro. This is sufficient to generate the Bode plot of any rational transfer function with delay. For example, the Bode phase plot in Figure \ref{multiBodeZPK} can also be generated using:
%\begin{verbatim}
-%\begin{BodePlot}[ylabel={Phase (degree)},ytick distance=90]{0.01}{100}
+%\begin{BodePhPlot}[ytick distance=90]{0.01}{100}
% \addBodeComponentPlot[black,thick]{\PhZero{0}{0} + \PhZero{-0.1}{-0.5} +
% \PhZero{-0.1}{0.5} + \PhPole{-0.5}{-10} + \PhPole{-0.5}{10} +
% \PhK{10}{0}}
@@ -594,17 +592,17 @@ Nyquist plots with additional commands, using two different macros
% \addBodeComponentPlot[blue,dotted,thick] {\PhZeroAsymp{0}{0} +
% \PhZeroAsymp{-0.1}{-0.5} + \PhZeroAsymp{-0.1}{0.5} +
% \PhPoleAsymp{-0.5}{-10} + \PhPoleAsymp{-0.5}{10} + \PhKAsymp{10}{40}}
-%\end{BodePlot}
+%\end{BodePhPlot}
%\end{verbatim}
%\begin{figure}
% \begin{center}
-% \begin{BodePlot}[ylabel={Phase (degree)},ytick distance=90]{0.01}{100}
+% \begin{BodePhPlot}[ytick distance=90]{0.01}{100}
% \addBodeComponentPlot[black,thick] {\PhZero{0}{0} + \PhZero{-0.1}{-0.5} + \PhZero{-0.1}{0.5} + \PhPole{-0.5}{-10} + \PhPole{-0.5}{10} + \PhK{10}{0}}
% \addBodeComponentPlot[red,dashed,thick] {\PhZeroLin{0}{0} + \PhZeroLin{-0.1}{-0.5} + \PhZeroLin{-0.1}{0.5} + \PhPoleLin{-0.5}{-10} + \PhPoleLin{-0.5}{10} + \PhKLin{10}{20}}
% \addBodeComponentPlot[blue,dotted,thick] {\PhZeroAsymp{0}{0} + \PhZeroAsymp{-0.1}{-0.5} + \PhZeroAsymp{-0.1}{0.5} + \PhPoleAsymp{-0.5}{-10} + \PhPoleAsymp{-0.5}{10} + \PhKAsymp{10}{40}}
-% \end{BodePlot}
+% \end{BodePhPlot}
% \end{center}
-% \caption{\label{multiBodeComponents}Superimposed approximate and true Bode Phase plot using the \texttt{BodePlot} environment, the \texttt{\textbackslash addBodeComponentPlot} macro, and several macros of the \texttt{\textbackslash TypeFeatureApprox} form.}
+% \caption{\label{multiBodeComponents}Superimposed approximate and true Bode Phase plot using the \texttt{BodePhPlot} environment, the \texttt{\textbackslash addBodeComponentPlot} macro, and several macros of the \texttt{\textbackslash TypeFeatureApprox} form.}
%\end{figure}
% which gives us the plot in Figure \ref{multiBodeComponents}.
%
@@ -620,21 +618,21 @@ Nyquist plots with additional commands, using two different macros
%
% \noindent This entry describes 2 different macros of the form |\MagSOFeaturePeak| that take the the coefficients $ a_1 $ and $ a_0 $ of a general second order system as inputs, and draw a resonant peak using the |\draw| TikZ macro. The |Feature| in the macro name should be replaced by either |Poles| or |Zeros| to generate a peak for poles and a valley for zeros, respectively. For example, the command
%\begin{verbatim}
-%\begin{BodePlot}[xlabel={}]{0.1}{10}
+%\begin{BodeMagPlot}[xlabel={}]{0.1}{10}
% \addBodeComponentPlot[red,dashed,thick]{\MagSOPoles{0.2}{1}}
% \addBodeComponentPlot[black,thick]{\MagSOPolesLin{0.2}{1}}
% \MagSOPolesPeak[thick]{0.2}{1}
-%\end{BodePlot}
+%\end{BodeMagPlot}
%\end{verbatim}
% generates the plot in Figure \ref{BodePeak}.
%
% \begin{figure}
% \begin{center}
-% \begin{BodePlot}[xlabel={}]{0.1}{10}
+% \begin{BodeMagPlot}[xlabel={}]{0.1}{10}
% \addBodeComponentPlot[red,dashed,thick]{\MagSOPoles{0.2}{1}}
% \addBodeComponentPlot[black,thick]{\MagSOPolesLin{0.2}{1}}
% \MagSOPolesPeak[very thick]{0.2}{1}
-% \end{BodePlot}
+% \end{BodeMagPlot}
% \end{center}
% \cprotect\caption{\label{BodePeak} Resonant peak in asymptotic Bode plot using |\MagSOPolesPeak|.}
% \end{figure}
@@ -727,7 +725,7 @@ Nyquist plots with additional commands, using two different macros
% |\addNyquistTFPlot|\oarg{plot-options}\\
% \hspace*{2em}\marg{num/\marg{coeffs},den/\marg{coeffs},d/\marg{delay}}
%
-% \noindent Similar to |\addNyquistZPKPlot|, with a transfer function input in the TF form.
+% \noindent Similar to |\addNyquistZPKPlot|, with a transfer function input in the TF form.
%
% \subsection{Nichols charts}
% \DescribeMacro{\NicholsZPK}
@@ -804,8 +802,7 @@ Nyquist plots with additional commands, using two different macros
% \begin{macro}{gnuplot@prefix}
% \changes{v1.0.3}{2021/11/03}{Added jobname to gnuplot prefix}
% \changes{v1.0.8}{2022/07/06}{Fixed issue \#6}
-% \begin{macro}{gnuplot@degrees}
-% This code is needed to support both |pgfplots| and |gnuplot| simultaneously. New macros are defined for the |pow| and |mod| functions to address differences between the two math engines. We start by processing the |pgf| and |declutter| class options.
+% This code is needed to support both |pgfplots| and |gnuplot| simultaneously. New macros are defined for the |pow| and |mod| functions to address differences between the two math engines. We start by processing the class options.
% \begin{macrocode}
\newif\if@pgfarg\@pgfargfalse
\DeclareOption{pgf}{%
@@ -815,21 +812,27 @@ Nyquist plots with additional commands, using two different macros
\DeclareOption{declutter}{%
\@declutterargtrue
}
+\newif\if@radarg\@radargfalse
+\DeclareOption{rad}{%
+ \@radargtrue
+}
\ProcessOptions\relax
% \end{macrocode}
% Then, we define two new macros to unify |pgfplots| and |gnuplot|.
% \begin{macrocode}
+\newcommand{\n@mod}[2]{(#1)-(floor((#1)/(#2))*(#2))}
\if@pgfarg
- \newcommand{\n@pow}[2]{(#1)^(#2)}%
- \newcommand{\n@mod}[2]{mod((#1),(#2))}%
+ \newcommand{\n@pow}[2]{(#1)^(#2)}
+ \pgfplotsset{%
+ trig format plots=rad%
+ }
\else
- \newcommand{\n@pow}[2]{(#1)**(#2)}%
- \newcommand{\n@mod}[2]{(#1)-(floor((#1)/(#2))*(#2))}%
+ \newcommand{\n@pow}[2]{(#1)**(#2)}
% \end{macrocode}
% Then, we create a counter so that a new data table is generated and for each new plot. If the plot macros have not changed, the tables, once generated, can be reused by |gnuplot|, which reduces compilation time. The |declutter| option is used to enable the |gnuplot| directory to declutter the working directory.
% \begin{macrocode}
- \newcounter{gnuplot@id}%
- \setcounter{gnuplot@id}{0}%
+ \newcounter{gnuplot@id}
+ \setcounter{gnuplot@id}{0}
\if@declutterarg
\tikzset{%
gnuplot@prefix/.style={%
@@ -846,21 +849,11 @@ Nyquist plots with additional commands, using two different macros
}
\fi
% \end{macrocode}
-% Then, we add |set angles degrees| to all |gnuplot| macros to avoid having to convert from degrees to radians everywhere.
-% \begin{macrocode}
- \pgfplotsset{%
- gnuplot@degrees/.code={%
- \ifnum\value{gnuplot@id}=1
- \xdef\pgfplots@gnuplot@format{\pgfplots@gnuplot@format set angles degrees;}%
- \fi
- }%
- }
-% \end{macrocode}
% If the operating system is not Windows, and if the |declutter| option is not passed, we create the |gnuplot| folder if it does not already exist. \changes{v1.0.2}{2021/11/01}{Fixed issue \#1}
% \begin{macrocode}
\ifwindows\else
\if@declutterarg
- \immediate\write18{mkdir -p gnuplot}%
+ \immediate\write18{mkdir -p gnuplot}
\fi
\fi
\fi
@@ -869,7 +862,6 @@ Nyquist plots with additional commands, using two different macros
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
% \begin{macro}{bode@style}
% Default axis properties for all plot macros are collected in this |pgf| style.
% \begin{macrocode}
@@ -889,6 +881,20 @@ Nyquist plots with additional commands, using two different macros
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{ph@filter}
+% \begin{macro}{ph@x@filter}
+% These macros create |pgf| filters to convert plots from radians to degrees.
+% \begin{macrocode}
+\if@radarg
+ \pgfplotsset{ph@filter/.style = {ytick distance=pi/4, ylabel={Phase (rad)}}}%
+ \pgfplotsset{ph@x@filter/.style = {xlabel={Phase (rad)}}}%
+\else
+ \pgfplotsset{ph@filter/.style = {y filter/.expression={y*180/pi}, ytick distance=45, ylabel={Phase (deg)}}}%
+ \pgfplotsset{ph@x@filter/.style = {x filter/.expression={x*180/pi}, xlabel={Phase (deg)}}}%
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \subsection{Parametric function generators for poles, zeros, gains, and delays.}
% \begin{macro}{\MagK}
% \begin{macro}{\MagKAsymp}
@@ -901,7 +907,7 @@ Nyquist plots with additional commands, using two different macros
\newcommand*{\MagK}[2]{(20*log10(abs(#1)))}
\newcommand*{\MagKAsymp}{\MagK}
\newcommand*{\MagKLin}{\MagK}
-\newcommand*{\PhK}[2]{(#1<0?-180:0)}
+\newcommand*{\PhK}[2]{(#1<0?-pi:0)}
\newcommand*{\PhKAsymp}{\PhK}
\newcommand*{\PhKLin}{\PhK}
% \end{macrocode}
@@ -916,7 +922,7 @@ Nyquist plots with additional commands, using two different macros
% True magnitude and phase parametric functions for a pure delay $G(s)=e^{-Ts}$. The macros take two arguments corresponding to real and imaginary part of the gain to facilitate code reuse between delays, gains, poles, and zeros, but only real gains are supported. The second argument, if supplied, is ignored.
% \begin{macrocode}
\newcommand*{\MagDel}[2]{0}
-\newcommand*{\PhDel}[2]{-#1*180*t/pi}
+\newcommand*{\PhDel}[2]{-#1*t}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -945,23 +951,23 @@ Nyquist plots with additional commands, using two different macros
% Parametric function for the true phase of a complex pole.
% \begin{macrocode}
\newcommand*{\PhPole}[2]{(#1 > 0 ? (#2 > 0 ?
- (\n@mod{-atan2((t - (#2)),-(#1))+360}{360}) :
+ (\n@mod{-atan2((t - (#2)),-(#1))}{2*pi}) :
(-atan2((t - (#2)),-(#1)))) :
(-atan2((t - (#2)),-(#1))))}
% \end{macrocode}
% Parametric function for linear approximation of the phase of a complex pole.
% \begin{macrocode}
\newcommand*{\PhPoleLin}[2]{%
- (abs(#1)+abs(#2) == 0 ? -90 :
- (t < (sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) /
- (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} + \n@pow{#2}{2}))})) ?
+ (abs(#1)+abs(#2) == 0 ? -pi/2 :
+ (t < (sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) /
+ (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} + \n@pow{#2}{2}))})) ?
(-atan2(-(#2),-(#1))) :
- (t >= (sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) *
- (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} + \n@pow{#2}{2}))})) ?
- (#2>0?(#1>0?270:-90):-90) :
- (-atan2(-(#2),-(#1)) + (log10(t/(sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) /
- (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} +
- \n@pow{#2}{2}))}))))*((#2>0?(#1>0?270:-90):-90) + atan2(-(#2),-(#1)))/
+ (t >= (sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) *
+ (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} + \n@pow{#2}{2}))})) ?
+ (#2>0?(#1>0?3*pi/2:-pi/2):-pi/2) :
+ (-atan2(-(#2),-(#1)) + (log10(t/(sqrt(\n@pow{#1}{2} + \n@pow{#2}{2}) /
+ (\n@pow{10}{sqrt(\n@pow{#1}{2}/(\n@pow{#1}{2} +
+ \n@pow{#2}{2}))}))))*((#2>0?(#1>0?3*pi/2:-pi/2):-pi/2) + atan2(-(#2),-(#1)))/
(log10(\n@pow{10}{sqrt((4*\n@pow{#1}{2})/
(\n@pow{#1}{2} + \n@pow{#2}{2}))}))))))}
% \end{macrocode}
@@ -969,7 +975,7 @@ Nyquist plots with additional commands, using two different macros
% \begin{macrocode}
\newcommand*{\PhPoleAsymp}[2]{(t < (sqrt(\n@pow{#1}{2} + \n@pow{#2}{2})) ?
(-atan2(-(#2),-(#1))) :
- (#2>0?(#1>0?270:-90):-90))}
+ (#2>0?(#1>0?3*pi/2:-pi/2):-pi/2))}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1026,10 +1032,10 @@ Nyquist plots with additional commands, using two different macros
\newcommand*{\PhCSPolesLin}[2]{(t < (#2 / (\n@pow{10}{abs(#1)})) ?
0 :
(t >= (#2 * (\n@pow{10}{abs(#1)})) ?
- (#1>0 ? -180 : 180) :
- (#1>0 ? (-180*(log10(t*(\n@pow{10}{#1})/#2))/(2*#1)) :
- (180*(log10(t*(\n@pow{10}{abs(#1)})/#2))/(2*abs(#1))))))}
-\newcommand*{\PhCSPolesAsymp}[2]{(#1>0?(t<#2?0:-180):(t<#2?0:180))}
+ (#1>0 ? -pi : pi) :
+ (#1>0 ? (-pi*(log10(t*(\n@pow{10}{#1})/#2))/(2*#1)) :
+ (pi*(log10(t*(\n@pow{10}{abs(#1)})/#2))/(2*abs(#1))))))}
+\newcommand*{\PhCSPolesAsymp}[2]{(#1>0?(t<#2?0:-pi):(t<#2?0:pi))}
% \end{macrocode}
% Plots of the inverse function $G(s)=s^2+2\zeta\omega_n s+\omega_n^2$ are defined to be negative of plots of poles. The |0-| is necessary due to a bug in |gnuplot| (fixed in version 5.4, patchlevel 3).
% \begin{macrocode}
@@ -1092,10 +1098,10 @@ Nyquist plots with additional commands, using two different macros
\newcommand*{\PhSOPoles}[2]{(-atan2((#1)*t,((#2) - \n@pow{t}{2})))}
\newcommand*{\PhSOPolesLin}[2]{(#2>0 ?
\PhCSPolesLin{(#1/(2*sqrt(#2)))}{(sqrt(#2))} :
- (#1>0 ? -180 : 180))}
+ (#1>0 ? -pi : pi))}
\newcommand*{\PhSOPolesAsymp}[2]{(#2>0 ?
\PhCSPolesAsymp{(#1/(2*sqrt(#2)))}{(sqrt(#2))} :
- (#1>0 ? -180 : 180))}
+ (#1>0 ? -pi : pi))}
% \end{macrocode}
% Plots of the inverse function $G(s)=s^2+as+b$ are defined to be negative of plots of poles. The |0-| is necessary due to a bug in |gnuplot| (fixed in version 5.4, patchlevel 3).
% \begin{macrocode}
@@ -1151,7 +1157,7 @@ Nyquist plots with additional commands, using two different macros
% \end{macrocode}
% The |\noexpand| macros below are needed to so that only the macro |\opt@group| is expanded. \changes{v1.0.3}{2021/11/03}{Added Tikz option}
% \begin{macrocode}
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{groupplot}[%
bode@style,
xmin={#3},
@@ -1167,48 +1173,35 @@ Nyquist plots with additional commands, using two different macros
% \end{macrocode}
% To ensure frequency tick marks on magnitude and the phase plots are always aligned, we use the |groupplot| library. The |\expandafter| chain below is used to expand macros in the plot and group optional arguments.
% \begin{macrocode}
- \if@pgfarg
- \expandafter\nextgroupplot\expandafter[ytick distance=20,
- ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optmag@plot]}%
- \temp@cmd {\func@mag};
- \optmag@commands
- \expandafter\nextgroupplot\expandafter[ytick distance=45,
- ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optph@plot]}%
- \temp@cmd {\func@ph};
- \optph@commands
- \else
+ \edef\temp@mag@cmd{\noexpand\nextgroupplot[ytick distance=20, ylabel={Gain (dB)}, xmajorticks=false, \optmag@axes]
+ \noexpand\addplot[variable=t, thick, \optmag@plot]}
+ \edef\temp@ph@cmd{\noexpand\nextgroupplot[ph@filter, xlabel={Frequency (rad/s)}, \optph@axes]
+ \noexpand\addplot[variable=t, thick, \optph@plot]}
% \end{macrocode}
% In |gnuplot| mode, we increment the |gnuplot@id| counter before every plot to make sure that new and reusable |.gnuplot| and |.table| files are generated for every plot.
% \begin{macrocode}
- \stepcounter{gnuplot@id}
- \expandafter\nextgroupplot\expandafter[ytick distance=20,
- ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optmag@plot]}%
- \temp@cmd gnuplot[gnuplot@degrees,gnuplot@prefix] {\func@mag};
+ \if@pgfarg\else
+ \edef\temp@mag@cmd{\noexpand\stepcounter{gnuplot@id} \unexpanded\expandafter{\temp@mag@cmd} gnuplot[gnuplot@prefix]}
+ \edef\temp@ph@cmd{\noexpand\stepcounter{gnuplot@id} \unexpanded\expandafter{\temp@ph@cmd} gnuplot[gnuplot@prefix]}
+ \fi
+ \temp@mag@cmd {\func@mag};
\optmag@commands
- \stepcounter{gnuplot@id}
- \expandafter\nextgroupplot\expandafter[ytick distance=45,
- ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optph@plot]}%
- \temp@cmd gnuplot[gnuplot@degrees,gnuplot@prefix] {\func@ph};
+ \temp@ph@cmd {\func@ph};
\optph@commands
- \fi
\end{groupplot}
\end{tikzpicture}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\BodeTF}
-% Implementation of this macro is very similar to the |\BodeZPK| macro above. The only difference is the lack of linear and asymptotic plots and slightly different parsing of the mandatory arguments. \changes{v1.0.3}{2021/11/03}{Added Tikz option}
+% Implementation of this macro is very similar to the |\BodeZPK| macro above. The only difference is the lack of linear and asymptotic plots and slightly different parsing of the mandatory arguments. \changes{v1.0.3}{2021/11/03}{Added Tikz option} \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}
% \begin{macrocode}
\newcommand{\BodeTF}[4][]{%
\parse@opt{#1}%
\gdef\func@mag{}%
\gdef\func@ph{}%
\build@TF@plot{\func@mag}{\func@ph}{#2}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{groupplot}[%
bode@style,
xmin={#3},
@@ -1221,31 +1214,22 @@ Nyquist plots with additional commands, using two different macros
]%
}%
\temp@cmd
+ \edef\temp@mag@cmd{\noexpand\nextgroupplot[ytick distance=20, ylabel={Gain (dB)}, xmajorticks=false, \optmag@axes]
+ \noexpand\addplot[variable=t, thick, \optmag@plot]}
+ \edef\temp@ph@cmd{\noexpand\nextgroupplot[ph@filter, xlabel={Frequency (rad/s)}, \optph@axes]
+ \noexpand\addplot[variable=t, thick, \optph@plot]}
+ \if@pgfarg\else
+ \edef\temp@mag@cmd{\noexpand\stepcounter{gnuplot@id} \unexpanded\expandafter{\temp@mag@cmd} gnuplot[gnuplot@prefix]}
+ \edef\temp@ph@cmd{\noexpand\stepcounter{gnuplot@id} \unexpanded\expandafter{\temp@ph@cmd} gnuplot[gnuplot@prefix]}
+ \fi
+ \temp@mag@cmd {\func@mag};
+ \optmag@commands
\if@pgfarg
- \expandafter\nextgroupplot\expandafter[ytick distance=20,
- ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optmag@plot]}%
- \temp@cmd {\func@mag};
- \optmag@commands
- \expandafter\nextgroupplot\expandafter[ytick distance=45,
- ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optph@plot]}%
- \temp@cmd {\func@ph};
- \optph@commands
+ \temp@ph@cmd {\n@mod{\func@ph}{2*pi}};
\else
- \stepcounter{gnuplot@id}%
- \expandafter\nextgroupplot\expandafter[ytick distance=20,
- ylabel={Gain (dB)},xmajorticks=false,\optmag@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optmag@plot]}%
- \temp@cmd gnuplot[gnuplot@degrees,gnuplot@prefix] {\func@mag};
- \optmag@commands
- \stepcounter{gnuplot@id}%
- \expandafter\nextgroupplot\expandafter[ytick distance=45,
- ylabel={Phase ($^{\circ}$)},xlabel={Frequency (rad/s)},\optph@axes]
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\optph@plot]}%
- \temp@cmd gnuplot[gnuplot@degrees,gnuplot@prefix] {\func@ph};
- \optph@commands
+ \temp@ph@cmd {'+' using (t):\func@ph smooth unwrap};
\fi
+ \optph@commands
\end{groupplot}
\end{tikzpicture}
}
@@ -1269,14 +1253,14 @@ Nyquist plots with additional commands, using two different macros
\else
\stepcounter{gnuplot@id}%
\edef\temp@cmd{\noexpand\addplot[variable=t,thick,\opt]}
- \temp@cmd gnuplot[gnuplot@degrees,gnuplot@prefix] {\plot@macro};
+ \temp@cmd gnuplot[gnuplot@prefix] {\plot@macro};
\fi
}%
}
% \end{macrocode}
%\end{macro}
% \begin{macro}{\addBodeTFPlot}
-% This macro is designed to issues a single |\addplot| macros for the set of coefficients and delay. All of the work is done by the |\build@TF@plot| macro.
+% This macro is designed to issues a single |\addplot| macros for the set of coefficients and delay. All of the work is done by the |\build@TF@plot| macro. \changes{v1.1.0}{2022/07/06}{Fixed phase wrapping in gnuplot mode}
% \begin{macrocode}
\newcommand{\addBodeTFPlot}[3][thick]{%
\gdef\plot@macro{}%
@@ -1287,10 +1271,18 @@ Nyquist plots with additional commands, using two different macros
\build@TF@plot{\plot@macro}{\temp@macro}{#3}%
\fi
\if@pgfarg
- \addplot[variable=t,#1]{\plot@macro};
+ \ifnum\pdfstrcmp{#2}{phase}=0
+ \addplot[variable=t,#1]{\n@mod{\plot@macro}{2*pi}};
+ \else
+ \addplot[variable=t,#1]{\plot@macro};
+ \fi
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[gnuplot@degrees, gnuplot@prefix] {\plot@macro};
+ \ifnum\pdfstrcmp{#2}{phase}=0
+ \addplot[variable=t,#1] gnuplot[gnuplot@prefix] {'+' using (t):\plot@macro smooth unwrap}
+ \else
+ \addplot[variable=t,#1] gnuplot[gnuplot@prefix] {\plot@macro};
+ \fi
\fi
}
% \end{macrocode}
@@ -1303,17 +1295,67 @@ Nyquist plots with additional commands, using two different macros
\addplot[variable=t,#1]{#2};
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[gnuplot@degrees,gnuplot@prefix] {#2};
+ \addplot[variable=t,#1] gnuplot[gnuplot@prefix] {#2};
\fi
}
% \end{macrocode}
%\end{macro}
+% \begin{environment}{BodePhPlot}
+% An environment to host phase plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}
+% \begin{macrocode}
+\newenvironment{BodePhPlot}[3][]{%
+ \parse@env@opt{#1}%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
+ \noexpand\begin{semilogxaxis}[%
+ ph@filter,
+ bode@style,
+ xmin={#2},
+ xmax={#3},
+ domain=#2:#3,
+ height=2.5cm,
+ xlabel={Frequency (rad/s)},
+ \unexpanded\expandafter{\opt@axes}
+ ]%
+ }
+ \temp@cmd
+}{
+ \end{semilogxaxis}
+ \end{tikzpicture}
+}
+% \end{macrocode}
+% \end{environment}
+% \begin{environment}{BodeMagPlot}
+% An environment to host magnitude plot macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments.\changes{v1.1.0}{2022/07/20}{Added separate environments for phase and magnitude plots}
+% \begin{macrocode}
+\newenvironment{BodeMagPlot}[3][]{%
+ \parse@env@opt{#1}%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
+ \noexpand\begin{semilogxaxis}[%
+ bode@style,
+ xmin={#2},
+ xmax={#3},
+ domain=#2:#3,
+ height=2.5cm,
+ xlabel={Frequency (rad/s)},
+ ylabel={Gain (dB)},
+ ytick distance=40,
+ \unexpanded\expandafter{\opt@axes}
+ ]%
+ }
+ \temp@cmd
+}{
+ \end{semilogxaxis}
+ \end{tikzpicture}
+}
+% \end{macrocode}
+% \end{environment}
% \begin{environment}{BodePlot}
-% An environment to host macros that pass parametric functions to |\addplot| macros. Uses the defaults specified in |bode@style| to create a shortcut that includes the |tikzpicture| and |semilogaxis| environments. \changes{v1.0.3}{2021/11/03}{Added tikz option to environments}
+% Same as |BodeMagPlot|. The |BodePlot| environment is deprecated as of v1.1.0, please use the |BodePhPlot| and |BodeMagPlot| environments instead.\changes{v1.0.3}{2021/11/03}{Added tikz option to environments}\changes{v1.1.0}{2022/02/20}{Deprecated BodePlot environment}
% \begin{macrocode}
\newenvironment{BodePlot}[3][]{%
+ \PackageWarning{bodeplot}{Since v1.1.0, the BodePlot environment returns phase plots in radian units only. Please use the BodePhPlot environment if degree units are needed.}%
\parse@env@opt{#1}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]
\noexpand\begin{semilogxaxis}[%
bode@style,
xmin={#2},
@@ -1323,7 +1365,7 @@ Nyquist plots with additional commands, using two different macros
xlabel={Frequency (rad/s)},
\unexpanded\expandafter{\opt@axes}
]%
- }%
+ }
\temp@cmd
}{
\end{semilogxaxis}
@@ -1475,8 +1517,8 @@ Nyquist plots with additional commands, using two different macros
\xdef\loop@delay{\values}%
\fi
}%
- \xdef#2{(\n@mod{atan2((\num@im),(\num@real))-atan2((\den@im),%
- (\den@real))-\loop@delay*180*t/pi+360}{360})}%
+ \xdef#2{(atan2((\num@im),(\num@real))-atan2((\den@im),%
+ (\den@real))-\loop@delay*t)}%
\xdef#1{(20*log10(sqrt((\n@pow{\num@real}{2})+(\n@pow{\num@im}{2})))-%
20*log10(sqrt((\n@pow{\den@real}{2})+(\n@pow{\den@im}{2}))))}%
}
@@ -1581,7 +1623,7 @@ Nyquist plots with additional commands, using two different macros
\gdef\func@mag{}%
\gdef\func@ph{}%
\build@ZPK@plot{\func@mag}{\func@ph}{}{#2}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
bode@style,
domain=#3:#4,
@@ -1594,14 +1636,14 @@ Nyquist plots with additional commands, using two different macros
}%
\temp@cmd
\addplot [only marks,mark=+,thick,red] (-1 , 0);
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\unexpanded\expandafter{\opt@plot}]}%
+ \edef\temp@cmd{\noexpand\addplot[variable=t, thick, \unexpanded\expandafter{\opt@plot}]}%
\if@pgfarg
\temp@cmd ( {\n@pow{10}{((\func@mag)/20)}*cos(\func@ph)},
{\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)} );
\opt@commands
\else
\stepcounter{gnuplot@id}%
- \temp@cmd gnuplot[parametric,gnuplot@degrees,gnuplot@prefix] {%
+ \temp@cmd gnuplot[parametric,gnuplot@prefix] {%
\n@pow{10}{((\func@mag)/20)}*cos(\func@ph),
\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)};
\opt@commands
@@ -1619,7 +1661,7 @@ Nyquist plots with additional commands, using two different macros
\gdef\func@mag{}%
\gdef\func@ph{}%
\build@TF@plot{\func@mag}{\func@ph}{#2}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
bode@style,
domain=#3:#4,
@@ -1632,14 +1674,14 @@ Nyquist plots with additional commands, using two different macros
}%
\temp@cmd
\addplot [only marks,mark=+,thick,red] (-1 , 0);
- \edef\temp@cmd{\noexpand\addplot[variable=t,thick,\unexpanded\expandafter{\opt@plot}]}%
+ \edef\temp@cmd{\noexpand\addplot[variable=t, thick, \unexpanded\expandafter{\opt@plot}]}%
\if@pgfarg
\temp@cmd ( {\n@pow{10}{((\func@mag)/20)}*cos(\func@ph)},
{\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)} );
\opt@commands
\else
\stepcounter{gnuplot@id}%
- \temp@cmd gnuplot[parametric,gnuplot@degrees,gnuplot@prefix]{%
+ \temp@cmd gnuplot[parametric,gnuplot@prefix]{%
\n@pow{10}{((\func@mag)/20)}*cos(\func@ph),
\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)};
\opt@commands
@@ -1661,7 +1703,7 @@ Nyquist plots with additional commands, using two different macros
{\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)} );
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[parametric,gnuplot@degrees,gnuplot@prefix]{%
+ \addplot[variable=t,#1] gnuplot[parametric,gnuplot@prefix]{%
\n@pow{10}{((\func@mag)/20)}*cos(\func@ph),
\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)};
\fi
@@ -1680,7 +1722,7 @@ Nyquist plots with additional commands, using two different macros
{\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)} );
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[parametric,gnuplot@degrees,gnuplot@prefix]{%
+ \addplot[variable=t,#1] gnuplot[parametric,gnuplot@prefix]{%
\n@pow{10}{((\func@mag)/20)}*cos(\func@ph),
\n@pow{10}{((\func@mag)/20)}*sin(\func@ph)};
\fi
@@ -1692,7 +1734,7 @@ Nyquist plots with additional commands, using two different macros
% \begin{macrocode}
\newenvironment{NyquistPlot}[3][]{%
\parse@env@opt{#1}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
bode@style,
height=5cm,
@@ -1758,12 +1800,12 @@ Nyquist plots with additional commands, using two different macros
\gdef\func@mag{}%
\gdef\func@ph{}%
\build@ZPK@plot{\func@mag}{\func@ph}{}{#2}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
+ ph@x@filter,
bode@style,
domain=#3:#4,
height=5cm,
- xlabel={Phase (degrees)},
ylabel={Gain (dB)},
samples=500,
\unexpanded\expandafter{\opt@axes}
@@ -1776,7 +1818,7 @@ Nyquist plots with additional commands, using two different macros
\opt@commands
\else
\stepcounter{gnuplot@id}%
- \temp@cmd gnuplot[parametric, gnuplot@degrees, gnuplot@prefix]
+ \temp@cmd gnuplot[parametric,gnuplot@prefix]
{ \func@ph , \func@mag };
\opt@commands
\fi
@@ -1788,12 +1830,12 @@ Nyquist plots with additional commands, using two different macros
\gdef\func@mag{}%
\gdef\func@ph{}%
\build@TF@plot{\func@mag}{\func@ph}{#2}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
+ ph@x@filter,
bode@style,
domain=#3:#4,
height=5cm,
- xlabel={Phase (degrees)},
ylabel={Gain (dB)},
samples=500,
\unexpanded\expandafter{\opt@axes}
@@ -1802,12 +1844,12 @@ Nyquist plots with additional commands, using two different macros
\temp@cmd
\edef\temp@cmd{\noexpand\addplot[variable=t,thick,\opt@plot]}%
\if@pgfarg
- \temp@cmd ( {\func@ph} , {\func@mag} );
+ \temp@cmd ( {\n@mod{\func@ph}{2*pi}} , {\func@mag} );
\opt@commands
\else
\stepcounter{gnuplot@id}%
- \temp@cmd gnuplot[parametric, gnuplot@degrees, gnuplot@prefix]
- { \func@ph , \func@mag };
+ \temp@cmd gnuplot[parametric,gnuplot@prefix]
+ { \n@mod{\func@ph}{2*pi} , \func@mag };
\opt@commands
\fi
\end{axis}
@@ -1815,12 +1857,12 @@ Nyquist plots with additional commands, using two different macros
}
\newenvironment{NicholsChart}[3][]{%
\parse@env@opt{#1}%
- \edef\temp@cmd{\noexpand\begin{tikzpicture}[\unexpanded\expandafter{\opt@tikz}]%
+ \edef\temp@cmd{\noexpand\begin{tikzpicture} [\unexpanded\expandafter{\opt@tikz}]%
\noexpand\begin{axis}[%
+ ph@x@filter,
bode@style,
domain=#2:#3,
height=5cm,
- xlabel={Phase (degrees)},
ylabel={Gain (dB)},
\unexpanded\expandafter{\opt@axes}
]%
@@ -1838,7 +1880,7 @@ Nyquist plots with additional commands, using two different macros
\addplot[variable=t,#1] ( {\func@ph} , {\func@mag} );
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[parametric,gnuplot@degrees,gnuplot@prefix]
+ \addplot[variable=t,#1] gnuplot[parametric,gnuplot@prefix]
{\func@ph , \func@mag};
\fi
}
@@ -1847,11 +1889,11 @@ Nyquist plots with additional commands, using two different macros
\gdef\func@ph{}%
\build@TF@plot{\func@mag}{\func@ph}{#2}%
\if@pgfarg
- \addplot[variable=t,#1] ( {\func@ph} , {\func@mag} );
+ \addplot[variable=t,#1] ( {\n@mod{\func@ph}{2*pi}} , {\func@mag} );
\else
\stepcounter{gnuplot@id}%
- \addplot[variable=t,#1] gnuplot[gnuplot@degrees,gnuplot@prefix]
- {\func@ph , \func@mag};
+ \addplot[variable=t,#1] gnuplot[gnuplot@prefix]
+ {\n@mod{\func@ph}{2*pi} , \func@mag};
\fi
}
% \end{macrocode}
diff --git a/graphics/pgf/contrib/bodeplot/bodeplot.pdf b/graphics/pgf/contrib/bodeplot/bodeplot.pdf
index 4ccba156a5..1660b2dc51 100644
--- a/graphics/pgf/contrib/bodeplot/bodeplot.pdf
+++ b/graphics/pgf/contrib/bodeplot/bodeplot.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tikzfill/CHANGES.md b/graphics/pgf/contrib/tikzfill/CHANGES.md
new file mode 100644
index 0000000000..23037f13d1
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/CHANGES.md
@@ -0,0 +1,23 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on
+[Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to
+[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+### Added
+### Changed
+### Deprecated
+### Removed
+### Fixed
+### Security
+
+
+
+## [1.00] - 2022-07-20
+
+### Added
+- Initial public release
diff --git a/graphics/pgf/contrib/tikzfill/README.md b/graphics/pgf/contrib/tikzfill/README.md
new file mode 100644
index 0000000000..2ce0a8735a
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/README.md
@@ -0,0 +1,56 @@
+# The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+
+
+> Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+
+> This work may be distributed and/or modified under the
+> conditions of the LaTeX Project Public License, either version 1.3
+> of this license or (at your option) any later version.
+> The latest version of this license is in
+> http://www.latex-project.org/lppl.txt
+> and version 1.3 or later is part of all distributions of LaTeX
+> version 2005/12/01 or later.
+
+> This work has the LPPL maintenance status `author-maintained`.
+
+> This work consists of all files listed in README.md
+
+
+`tikzfill` is a collection of *TikZ* libraries which add
+further options to fill *TikZ* paths with images and
+patterns. The libraries comprise fillings with images from
+files and from *TikZ* pictures. Also, patterns of hexagons
+and of rhombi are provided.
+
+
+## Contents of the package
+
+- `README.md` this file
+- `CHANGES.md` log of changes (history)
+- `tikzfill.sty` LaTeX package file (style file)
+- `tikzfill-common.sty` LaTeX package file (style file)
+- `tikzfill.hexagon.sty` LaTeX package file (style file)
+- `tikzfill.image.sty` LaTeX package file (style file)
+- `tikzfill.rhombus.sty` LaTeX package file (style file)
+- `tikzlibraryfill.hexagon.code.tex` TikZ library file
+- `tikzlibraryfill.image.code.tex` TikZ library file
+- `tikzlibraryfill.rhombus.code.tex` TikZ library file
+- `tikzfill.pdf` Documentation for tikzfill
+- `tikzfill.tex` Source code of the documentation
+- `tikzfill-doc.sty` Source code of the documentation
+
+
+## Installation
+
+Copy the contents of the `tikzfill.tds.zip` from CTAN to your local TeX file tree.
+
+Alternatively, put the files to their respective locations within the TeX installation:
+
+- `tikzfill.sty` -> /tex/latex/tikzfill
+- `tikzfill-common.sty` -> /tex/latex/tikzfill
+- `tikzfill.hexagon.sty` -> /tex/latex/tikzfill
+- `tikzfill.image.sty` -> /tex/latex/tikzfill
+- `tikzfill.rhombus.sty` -> /tex/latex/tikzfill
+- `tikzlibraryfill.hexagon.code.tex` -> /tex/latex/tikzfill
+- `tikzlibraryfill.image.code.tex` -> /tex/latex/tikzfill
+- `tikzlibraryfill.rhombus.code.tex` -> /tex/latex/tikzfill
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill-common.sty b/graphics/pgf/contrib/tikzfill/tikzfill-common.sty
new file mode 100644
index 0000000000..2adb2a7cea
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill-common.sty
@@ -0,0 +1,56 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill-common.sty: auxiliary code for library loading
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{tikzfill-common}[2022/07/20 v1.0.0 Auxiliary code for tikzfill]
+\RequirePackage{tikz}
+
+\ExplSyntaxOn
+
+\cs_new_nopar:Npn \__tikzfill_usetikzlibrary:n #1
+ {
+ \cs_if_exist:NTF \tikzfillpkgprefix
+ {
+ \bool_set:Nn \l_tmpa_bool { \tl_if_blank_p:V \tikzfillpkgprefix }
+ }
+ {
+ \bool_set_true:N \l_tmpa_bool
+ }
+ \bool_if:NTF \l_tmpa_bool
+ {
+ \usetikzlibrary{ #1 }
+ }
+ {
+ \cs_if_exist:NF \l__tikzfill_library_seq
+ {
+ \seq_new:N \l__tikzfill_library_seq
+ }
+ \seq_set_from_clist:Nn \l__tikzfill_library_seq { #1 }
+ \seq_map_inline:Nn \l__tikzfill_library_seq
+ {
+ \cs_if_exist:cF { tikz@library@ ##1 @loaded }
+ {
+ \cs_gset:cpn { tikz@library@ ##1 @loaded }{}
+ \input{ \tikzfillpkgprefix tikzlibrary ##1 .code.tex}
+ }
+ }
+ }
+ }
+
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill-doc.sty b/graphics/pgf/contrib/tikzfill/tikzfill-doc.sty
new file mode 100644
index 0000000000..60b1320964
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill-doc.sty
@@ -0,0 +1,130 @@
+% !TeX encoding=UTF-8
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill-doc.sty: style file for the documentation
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\def\version{1.0.0}%
+\def\datum{2022/07/20}%
+
+\def\tikzfillpkgprefix{}
+\IfFileExists{tikzfill-doc.cfg}{\input{tikzfill-doc.cfg}}{}
+
+% prevent hypdoc from loading (sets hyperindex=false)
+%\@namedef{ver@hypdoc.sty}{9999/12/31}
+%\@namedef{opt@hypdoc.sty}{hypdoc}
+
+
+\RequirePackage[T1]{fontenc}
+\RequirePackage[utf8]{inputenc}
+\RequirePackage[english]{babel}
+\RequirePackage{lmodern,parskip,array,makeidx}
+\RequirePackage{amsmath,amssymb}
+\RequirePackage[svgnames,table,hyperref]{xcolor}
+\RequirePackage{tikz,siunitx,xfp,tabularray}
+\usetikzlibrary{patterns,shadings,fadings}
+\RequirePackage{varioref}
+\RequirePackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
+\urlstyle{sf}
+\RequirePackage{cleveref}
+
+\RequirePackage[a4paper,left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm,
+ marginparsep=3mm,marginparwidth=18mm,
+ headheight=0mm,headsep=0cm,
+ footskip=1.5cm,includeheadfoot]{geometry}
+\RequirePackage{fancyhdr}
+\fancyhf{}
+\fancyfoot[C]{\thepage}%
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+\pagestyle{fancy}
+\tolerance=2000%
+\setlength{\emergencystretch}{20pt}%
+
+\RequirePackage{longtable,booktabs,ifthen,etoolbox}
+
+\RequirePackage{shortvrb}
+\AtBeginDocument{\MakeShortVerb{\|}}
+
+\RequirePackage{tcolorbox}
+\tcbuselibrary{skins,minted,breakable,documentation,raster,hooks}
+
+\definecolor{Green_Dark}{rgb}{0.078431,0.407843,0.176471}
+\definecolor{Blue_Dark}{rgb}{0.090196,0.211765,0.364706}
+\definecolor{Blue_Bright}{rgb}{0.858824,0.898039,0.945098}
+
+\tcbset{skin=enhanced,
+ sbs/.style={sidebyside,before lower app={\tcbset{sidebyside=false}}},
+ minted options={fontsize=\footnotesize},
+ doc raster={raster before skip=4mm plus 2mm minus 1mm},
+ doc head={colback=yellow!10!white,interior style=fill},
+ doc head key={colback=magenta!5!white,interior style=fill},
+ color key=DarkViolet,
+ color value=Teal,
+ color color=Teal,
+ color counter=Orange!85!black,
+ color length=Orange!85!black,
+ index colorize,
+ index annotate,
+ beforeafter example/.style={
+ before skip balanced=4pt plus 2pt minus 1pt,
+ after skip balanced=6pt plus 2pt minus 1pt
+ },
+ docexample/.style={bicolor,
+ beforeafter example,
+ arc is angular,fonttitle=\bfseries,
+ fontlower=\footnotesize,
+ colframe=green!25!yellow!50!black,
+ colback=green!25!yellow!7,
+ colbacklower=white,
+ drop fuzzy shadow=green!25!yellow!50!black,
+ listing engine=minted,
+ documentation minted style=colorful,
+ documentation minted options={fontsize=\footnotesize},
+ },
+}
+
+\renewcommand*{\tcbdocnew}[1]{\textcolor{green!50!black}{\sffamily\bfseries N} #1}
+\renewcommand*{\tcbdocupdated}[1]{\textcolor{blue!75!black}{\sffamily\bfseries U} #1}
+
+\NewDocumentCommand{\csvsorter}{}{\textsf{\bfseries\color{red!20!black}CSV-Sorter}}
+
+\newtcbinputlisting{\csvlisting}[1]{docexample,minted options={fontsize=\footnotesize},minted language=latex,
+ fonttitle=\bfseries,listing only,title={CSV file \flqq\texttt{\detokenize{#1.csv}}\frqq},listing file=#1.csv}
+
+\newtcbinputlisting{\xmllisting}[1]{docexample,minted options={fontsize=\footnotesize},minted language=xml,
+ fonttitle=\bfseries,listing only,title={Configuration file \flqq\texttt{\detokenize{#1.xml}}\frqq},listing file=#1.xml}
+
+\NewTotalTCBox{\verbbox}{m}{enhanced,on line,size=fbox,frame empty,colback=red!5!white,
+ colupper=red!85!black,fontupper=\bfseries\ttfamily}{\detokenize{"}#1\detokenize{"}}
+
+\NewDocumentCommand{\ctanpkg}{m}
+ {%
+ \href{https://ctan.org/pkg/#1}{\texttt{#1}}%
+ }
+
+\def\tikzname{Ti\emph{k}Z}
+
+\tcbmakedocSubKey{docTikzKey}{tikz}
+\tcbmakedocSubKeys{docTikzKeys}{tikz}
+\tcbmakedocSubKey{docPatternKey}{pgf/pattern keys}
+\tcbmakedocSubKeys{docPatternKeys}{pgf/pattern keys}
+
+
+\makeindex
+
+\pdfsuppresswarningpagegroup=1
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.hexagon.sty b/graphics/pgf/contrib/tikzfill/tikzfill.hexagon.sty
new file mode 100644
index 0000000000..66ad292e47
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.hexagon.sty
@@ -0,0 +1,24 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill.hexagon.sty: filling with hexagon patterns
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesPackage{tikzfill.hexagon}[2022/07/20 v1.0.0 Hexagon pattern library for TikZ]
+\RequirePackage{tikzfill-common}
+\ExplSyntaxOn
+\__tikzfill_usetikzlibrary:n { fill.hexagon }
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.image.sty b/graphics/pgf/contrib/tikzfill/tikzfill.image.sty
new file mode 100644
index 0000000000..fb7bb3e030
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.image.sty
@@ -0,0 +1,24 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill.image.sty: filling with images
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesPackage{tikzfill.image}[2022/07/20 v1.0.0 Image filling library for TikZ]
+\RequirePackage{tikzfill-common}
+\ExplSyntaxOn
+\__tikzfill_usetikzlibrary:n { fill.image }
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.pdf b/graphics/pgf/contrib/tikzfill/tikzfill.pdf
new file mode 100644
index 0000000000..e68d134f78
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.rhombus.sty b/graphics/pgf/contrib/tikzfill/tikzfill.rhombus.sty
new file mode 100644
index 0000000000..58deb47655
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.rhombus.sty
@@ -0,0 +1,24 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill.rhombus.sty: filling with rhombus patterns
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesPackage{tikzfill.rhombus}[2022/07/20 v1.0.0 Rhombus pattern library for TikZ]
+\RequirePackage{tikzfill-common}
+\ExplSyntaxOn
+\__tikzfill_usetikzlibrary:n { fill.rhombus }
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.sty b/graphics/pgf/contrib/tikzfill/tikzfill.sty
new file mode 100644
index 0000000000..c9a622b9e5
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.sty
@@ -0,0 +1,24 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill.sty: load all fill libraries
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesPackage{tikzfill}[2022/07/20 v1.0.0 Image and pattern libraries for TikZ]
+\RequirePackage{tikzfill-common}
+\ExplSyntaxOn
+\__tikzfill_usetikzlibrary:n { fill.image, fill.hexagon, fill.rhombus }
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzfill.tex b/graphics/pgf/contrib/tikzfill/tikzfill.tex
new file mode 100644
index 0000000000..4762f59771
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzfill.tex
@@ -0,0 +1,1385 @@
+% \LaTeX-Main\
+% !TeX encoding=UTF-8
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzfill.tex: Manual
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+% \RequirePackage[check-declarations,enable-debug]{expl3}
+\documentclass[a4paper,11pt]{article}
+\usepackage{tikzfill-doc}
+
+\usepackage{\tikzfillpkgprefix tikzfill}
+
+\hypersetup{
+ pdftitle={Manual for the tikzfill package},
+ pdfauthor={Thomas F. Sturm},
+ pdfsubject={TikZ libraries for filling with images and patterns},
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+
+\begin{tcboutputlisting}
+% \documentclass[a4paper]{article}
+% \usepackage{tikzfill}
+% \usetikzlibrary{fadings,shadings}
+% \usepackage[skins,breakable]{tcolorbox}
+% \usepackage{ninecolors}
+% \begin{document}
+\begin{tcolorbox}[spread,blankest,phantom={\thispagestyle{empty}}]
+\begin{tikzfadingfrompicture}[name=titlepicture]
+ \path
+ [
+ pattern hexagon cycle = { size=28mm, rings=5 },
+ pattern color = white,
+ ]
+ (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle
+ (\tcbtextwidth/2,\tcbtextheight/2);
+\end{tikzfadingfrompicture}%
+%
+\begin{tikzpicture}
+ \fill
+ [
+ upper left = blue5, upper right = cyan5,
+ lower left = magenta5, lower right = blue5,
+ ]
+ (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle
+ (\tcbtextwidth/2,\tcbtextheight/2);
+\shade
+ [
+ path fading = titlepicture,
+ fit fading = false,
+ upper left = blue6, upper right = cyan6,
+ lower left = magenta6, lower right = blue6,
+ ]
+ (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle
+ (\tcbtextwidth/2,\tcbtextheight/2);
+\node[white,font=\Huge\bfseries] (title) at (0,\tcbtextheight/4)
+ {The \texttt{tikzfill} package};
+\node[white,font=\Large\bfseries,below=8mm] (title) at (title.south)
+ {Manual for version \version\ (\datum)};
+\node[white,font=\large\bfseries,below=8mm] (title) at (title.south)
+ {Thomas F.~Sturm};
+\end{tikzpicture}
+\end{tcolorbox}
+% \end{document}
+\end{tcboutputlisting}
+\tcbuselistingtext
+\tcbinputlisting{title=Cover code,docexample,listing only}
+
+\clearpage
+
+\begin{center}
+\begin{tcolorbox}[enhanced,hbox,tikznode,left=8mm,right=8mm,boxrule=0.4pt,
+ colback=white,colframe=black!50!yellow,
+ drop lifted shadow=black!50!yellow,arc is angular,
+ before=\par\vspace*{5mm},after=\par\bigskip]
+{\bfseries\LARGE The \texttt{tikzfill} package}\\[3mm]
+{\large Manual for version \version\ (\datum)}
+\end{tcolorbox}
+{\large Thomas F.~Sturm%
+ \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
+ Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
+ email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip
+\normalsize\url{https://www.ctan.org/pkg/tikzfill}\par
+\url{https://github.com/T-F-S/tikzfill}
+}
+\end{center}
+\bigskip
+\begin{absquote}
+ \begin{center}\bfseries Abstract\end{center}
+ |tikzfill| is a collection of \tikzname\ libraries which add further
+ options to fill \tikzname\ paths with images and patterns.
+ The libraries comprise fillings with images from files and from \tikzname\ pictures.
+ Also, patterns of hexagons and of rhombi are provided.
+\end{absquote}
+
+\clearpage
+\tableofcontents
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\section{Short Introduction}\label{sec:intro}
+
+\tikzname\ is a very advanced and comprehensive graphics package for \LaTeX.
+The package |tikzfill| comprises a collection of libraries for \tikzname\, which
+add further options to fill \tikzname\ paths with images and patterns.
+
+For \LaTeX, the provided libraries can be loaded using the preferred
+\tikzname\ mechanism by
+\begin{dispListing*}{}
+\usetikzlibrary{fill.***} % LATEX (primary choice) and plain TEX
+\end{dispListing*}
+where |***| is to be replaced by the actual library name found on the following pages.
+
+Alternatively, the libraries can be loaded using \LaTeX\ style files
+\begin{dispListing*}{}
+\usepackage{tikzfill.***} % LATEX (secondary choice)
+\end{dispListing*}
+
+If you want to load all \tikzname\ libraries of this package, you can use
+the following \LaTeX\ style file
+\begin{dispListing*}{}
+\usepackage{tikzfill} % load all libraries
+\end{dispListing*}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\section{Image and Picture Fill Library}\label{sec:imagefill}%
+
+\begin{dispListing*}{title=\tikzname\ Library |fill.image|}
+\usetikzlibrary{fill.image} % LATEX (primary choice) and plain TEX
+\usetikzlibrary[fill.image] % ConTEXt
+\usepackage{tikzfill.image} % LATEX (secondary choice)
+\end{dispListing*}
+
+This library defines options to fill graphs with images or arbitray pictures.
+
+Until |tcolorbox| version 5.1.1 (2022/06/24), the code of this library was part
+of |tcolorbox|. Now, on suggestion of
+\href{https://github.com/muzimuzhi}{muzimuzhi},
+it is a separate library usable without |tcolorbox|. Also, the code is
+completely rewritten with |expl3|.
+
+
+
+\subsection{Fill Plain}
+\begin{docTikzKey}{fill plain image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is put in the center of the path, but it is not resized to fit into
+ the path area.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill plain image=goldshade.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill plain image*}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is put in the center of the path, but it is not resized to fit into
+ the path area.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,
+ fill plain image*={width=2.5cm}{goldshade.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+\enlargethispage*{8mm}
+
+\begin{docTikzKey}{fill plain picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with the given \meta{graphical code}.
+ The result is put in the center of the path, but it is not resized to fit into
+ the path area. Note that this is almost identical to the standard |path picture| option.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill plain picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Fill Stretch}
+\begin{docTikzKey}{fill stretch image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is stretched to fill the path area.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill stretch image=goldshade.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill stretch image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+ The image is stretched to fill the path area.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill stretch image*=
+ {angle=90,origin=c}{goldshade.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill stretch picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with the given \meta{graphical code}.
+ The result is stretched to fill the path area.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill stretch picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Fill Overzoom}
+\begin{docTikzKey}{fill overzoom image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is zoomed such that the path area fills the image.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill overzoom image=goldshade.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill overzoom image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+ The image is zoomed such that the path area fills the image.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill overzoom image*=
+ {angle=90,origin=c}{goldshade.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill overzoom picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with the given \meta{graphical code}.
+ The result is zoomed such that the path area fills the image.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill overzoom picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Fill Zoom}
+\begin{docTikzKey}{fill zoom image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is zoomed such that it fits inside the path area.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill zoom image=goldshade.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill zoom image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+ The image is zoomed such that it fits inside the path area.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill zoom image*=
+ {angle=90,origin=c}{goldshade.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill zoom picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with the given \meta{graphical code}.
+ The result is zoomed such that it fits inside the path area.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill zoom picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Fill Shrink}
+\begin{docTikzKey}{fill shrink image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The image is zoomed such that it fits inside the path area, but it never
+ gets enlarged.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill shrink image=goldshade.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill shrink image*}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with an external image referenced by \meta{file name}.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+ The image is zoomed such that it fits inside the path area, but it never
+ gets enlarged.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,
+ fill shrink image*={width=1.5cm}{goldshade.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill shrink picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with the given \meta{graphical code}.
+ The result is zoomed such that it fits inside the path area, but it never
+ gets enlarged.
+ Typically, some parts of the path area will stay unfilled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill shrink picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Fill Tile}
+\begin{docTikzKey}{fill tile image}{=\meta{file name}}{no default, initially unset}
+ Fills the current path with a tile pattern using an external image referenced by \meta{file name}.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill tile image=pink_marble.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill tile image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset}
+ Fills the current path with a tile pattern using an external image referenced by \meta{file name}.
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill tile image*={width=8mm}{pink_marble.png}]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+\begin{docTikzKey}{fill tile picture}{=\meta{graphical code}}{no default, initially unset}
+ Fills the current path with a tile pattern using the given \meta{graphical code}.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill tile picture={%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill tile picture*}{=\marg{fraction}\marg{graphical code}}{no default, initially unset}
+ Fills the current path with a tile pattern using the given \meta{graphical code}.
+ The graphic is resized by \meta{fraction}.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[draw,fill tile picture*={0.25}{%
+ \draw[red!50!yellow,line width=2mm]
+ (0,0) circle (8mm);
+ \draw[red,line width=5mm] (-1,-1) -- (1,1);
+ \draw[red,line width=5mm] (-1,1) -- (1,-1);
+ }]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\clearpage
+\subsection{Filling Options}
+\begin{docTikzKey}{fill image opacity}{=\meta{fraction}}{no default, initially |1.0|}
+ Sets the fill opacity for the image or picture fill options to the given \meta{fraction}.
+\begin{dispExample}
+\begin{tikzpicture}
+\path[fill stretch image=goldshade.png] (0,0) circle (8mm);
+\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.75]
+ (2,0) circle (8mm);
+\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.5]
+ (4,0) circle (8mm);
+\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.25]
+ (6,0) circle (8mm);
+\path[fill=red] (8,0) circle (8mm);
+\end{tikzpicture}
+\end{dispExample}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill image scale}{=\meta{fraction}}{no default, initially |1.0|}
+ Stretches, zooms, overzooms or shrinks the image or picture to the given \meta{fraction} of the
+ width and height of the current path.
+\begin{dispExample}
+\begin{tikzpicture}
+\path[draw,fill zoom image=goldshade.png]
+ (0,0) rectangle +(2,2);
+
+\path[draw,fill zoom image=goldshade.png,fill image scale=0.75]
+ (3,0) rectangle +(2,2);
+
+\path[draw,fill zoom image=goldshade.png,fill image scale=1.5]
+ (6,0) rectangle +(2,2);
+\end{tikzpicture}
+\end{dispExample}
+\end{docTikzKey}
+
+
+\begin{docTikzKey}{fill image options}{=\meta{graphics options}}{no default, initially empty}
+ The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command
+ for the image fill options. This can be just together with
+ \refKey{/tikz/fill stretch image}, \refKey{/tikz/fill overzoom image}, \refKey{/tikz/fill zoom image},
+ and \refKey{/tikz/fill tile image}.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\path[fill image options={width=8mm},
+ fill tile image=pink_marble.png]
+ (2.75,-0.75) -- (3,0) -- (2.75,0.75)
+ \foreach \w in {45,90,...,315}
+ { -- (\w:1.5cm) } -- cycle;
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{dispExample*}{sbs,lefthand ratio=0.6,center lower,fonttitle=\bfseries,
+ title=Image blending example}
+\begin{tikzpicture}[every node/.style=
+ {circle,minimum width=2cm}]
+\node[fill stretch image=blueshade.png]
+ (A) at (120:3cm) {A};
+\node[fill stretch image=goldshade.png]
+ (B) at (60:3cm) {B};
+\node[
+ preaction={fill stretch image=blueshade.png},
+ fill stretch image=goldshade.png,
+ fill image opacity=0.5] (C) {C};
+\path (A) -- node{$+$} (B);
+\draw[->,very thick] (A)--(C);
+\draw[->,very thick] (B)--(C);
+\end{tikzpicture}
+\end{dispExample*}
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\section{Hexagon Pattern Library}\label{sec:hexagon}%
+
+\begin{dispListing*}{title=\tikzname\ Library |fill.hexagon|}
+\usetikzlibrary{fill.hexagon} % LATEX (primary choice) and plain TEX
+\usetikzlibrary[fill.hexagon] % ConTEXt
+\usepackage{tikzfill.hexagon} % LATEX (secondary choice)
+\end{dispListing*}
+
+Based on |patterns.meta|, this library defines new hexagon patterns to fill graphs.
+
+
+
+%-------------------------------------------------------------------------------
+\subsection{Hexagon}
+The \docValue{hexagon} pattern draws hexagons which may be filled or outlined.
+A single pattern is one of two different \emph{bands}, called band 0 and band 1.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern = { hexagon
+ [
+ size = 5mm, angle = 15, line width = 1mm
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+Both bands together build a uniform combined pattern.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction = {
+ pattern = { hexagon
+ [
+ size = 5mm, angle = 15, line width = 1mm, band = 1
+ ]},
+ pattern color=blue },
+ pattern = { hexagon
+ [
+ size = 5mm, angle = 15, line width = 1mm, band = 0
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+\begin{docTikzKey}{pattern hexagon}{=\marg{pattern keys}}{style, no default}
+ Convenience shortcut for setting the combined pattern (in one color).
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ size = 5mm, angle = 15, line width = 1mm
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+\clearpage
+
+\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|}
+ The given \meta{size} denotes the length of an edge of one hexagonical tile
+ where the (possibly smaller) hexagon is located in.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ size = 5mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\begin{docPatternKey}{fill}{}{no value, initially set}
+ Sets the hexagons to be filled. |fill| and |draw| are mutually exclusionary.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ fill,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{draw}{}{no value, initially unset}
+ Sets the hexagons to be outlined. |fill| and |draw| are mutually exclusionary.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ draw,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|}
+ Sets the \meta{length} value of the line width.
+ This is only relevant, if the hexagons are not filled.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ draw, line width = 1mm,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\begin{docPatternKeys}
+ {
+ {
+ doc name = xshift,
+ doc parameter = {=\meta{xshift}},
+ doc description = {no default, initially |0pt|}
+ },
+ {
+ doc name = yshift,
+ doc parameter = {=\meta{yshift}},
+ doc description = {no default, initially |0pt|}
+ }
+ }
+ The pattern is shifted by \meta{xshift} and \meta{yshift}.
+ \par
+ Note that for \docValue*{hexagon} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction={pattern hexagon grid, pattern color=blue},
+ pattern hexagon =
+ {
+ xshift=3mm, yshift=1mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKeys}
+
+
+
+\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|}
+ The pattern is rotated by the given \meta{angle}.
+ \par
+ Note that for \docValue*{hexagon} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon =
+ {
+ angle = 15,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\begin{docPatternKey}{pos}{=\meta{value}}{no default, initially |0.8|}
+ Sets the edge position with a \meta{value} between 0 and 1, where $0$ is
+ the center and $1$ the outer rim of the hexagonical tile. $1$ is a less
+ efficient way to either fill the whole graph or to draw a \docValue*{hexagon grid}.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction={ pattern hexagon={pos=0.8},
+ pattern color=blue!80!red },
+ preaction={ pattern hexagon={pos=0.6},
+ pattern color=blue!60!red },
+ preaction={ pattern hexagon={pos=0.4},
+ pattern color=blue!40!red },
+ pattern hexagon={pos=0.2},
+ pattern color=blue!20!red,
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\clearpage
+
+
+\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|}
+ \meta{number} can take 0 or 1 and denotes one of two different bands of the pattern.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction = { pattern={hexagon[band=1,draw,
+ line width=1mm]},
+ pattern color=blue },
+ pattern={hexagon[band=0,pos=0.5]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\clearpage
+%-------------------------------------------------------------------------------
+\subsection{Hexagon Grid}
+The \docValue{hexagon grid} pattern draws a grid made of hexagons. It is
+a single pattern und more efficient than \docValue*{hexagon} with settings |draw,pos=1|.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern = { hexagon grid
+ [
+ size = 5mm, angle = 15, line width = 1mm
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+
+\begin{docTikzKey}{pattern hexagon grid}{=\marg{pattern keys}}{style, no default}
+ Convenience shortcut for setting the pattern to \docValue{hexagon grid}:
+\begin{dispListing}
+ pattern = { hexagon grid [ ... ] }
+\end{dispListing}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon grid =
+ {
+ size = 5mm, angle = 15, line width = 1mm
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+
+\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|}
+ The given \meta{size} denotes the length of an edge of one hexagon.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon grid =
+ {
+ size = 5mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+\clearpage
+
+
+\begin{docPatternKeys}
+ {
+ {
+ doc name = xshift,
+ doc parameter = {=\meta{xshift}},
+ doc description = {no default, initially |0pt|}
+ },
+ {
+ doc name = yshift,
+ doc parameter = {=\meta{yshift}},
+ doc description = {no default, initially |0pt|}
+ }
+ }
+ The pattern is shifted by \meta{xshift} and \meta{yshift}.
+ \par
+ Note that for \docValue*{hexagon grid} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction={pattern={hexagon grid}, pattern color=blue},
+ pattern hexagon grid =
+ {
+ xshift=3mm, yshift=1mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKeys}
+
+
+\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|}
+ The pattern is rotated by the given \meta{angle}.
+ \par
+ Note that for \docValue*{hexagon grid} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon grid =
+ {
+ angle = 15,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|}
+ Sets the \meta{length} value of the line width.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon grid =
+ {
+ line width = 2mm,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\clearpage
+%-------------------------------------------------------------------------------
+\subsection{Hexagon Cycle}
+The \docValue{hexagon cycle} pattern draws several hexagon rings in a cyclic manor.
+A single pattern is one of two different \emph{bands}, called band 0 and band 1.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern = { hexagon cycle
+ [
+ size = 5mm, angle = 15
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+Both bands together build a uniform combined pattern.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction = {
+ pattern = { hexagon cycle
+ [
+ size = 5mm, angle = 15, band = 1
+ ]},
+ pattern color=blue },
+ pattern = { hexagon cycle
+ [
+ size = 5mm, angle = 15, band = 0
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+\begin{docTikzKey}{pattern hexagon cycle}{=\marg{pattern keys}}{style, no default}
+ Convenience shortcut for setting the combined pattern (in one color).
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon cycle =
+ {
+ size = 5mm, angle = 15
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+\clearpage
+
+\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|}
+ The given \meta{size} denotes the length of an edge of one hexagonical tile
+ where the (smaller) hexagons are located in.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon cycle =
+ {
+ size = 5mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKeys}
+ {
+ {
+ doc name = xshift,
+ doc parameter = {=\meta{xshift}},
+ doc description = {no default, initially |0pt|}
+ },
+ {
+ doc name = yshift,
+ doc parameter = {=\meta{yshift}},
+ doc description = {no default, initially |0pt|}
+ }
+ }
+ The pattern is shifted by \meta{xshift} and \meta{yshift}.
+ \par
+ Note that for \docValue*{hexagon cycle} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ postaction={pattern={hexagon grid}, pattern color=blue},
+ pattern hexagon cycle =
+ {
+ xshift=3mm, yshift=1mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKeys}
+
+
+\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|}
+ The pattern is rotated by the given \meta{angle}.
+ \par
+ Note that for \docValue*{hexagon cycle} is valid, that a pattern is shifted first and rotated afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon cycle =
+ {
+ angle = 15,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\clearpage
+
+
+\begin{docPatternKey}{rings}{=\meta{number}}{no default, initially |3|}
+ Sets the \meta{number} of rings as $0, 1, 2, 3, \ldots$
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon cycle =
+ {
+ rings = 2,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{gap}{=\meta{value}}{no default, initially |1|}
+ Sets the gap between two rings as \meta{value} times the line width of a ring.
+ \meta{value} has to be greater or equal $0.01$.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern hexagon cycle =
+ {
+ gap = 0.5,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|}
+ \meta{number} can take 0 or 1 and denotes one of two different bands of the pattern.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction = { pattern={hexagon cycle[
+ band=1, gap=0.5 ]}, pattern color=blue },
+ pattern={hexagon cycle[band=0,rings=2]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\section{Rhombus Pattern Library}\label{sec:rhombus}%
+
+\begin{dispListing*}{title=\tikzname\ Library |fill.rhombus|}
+\usetikzlibrary{fill.rhombus} % LATEX (primary choice) and plain TEX
+\usetikzlibrary[fill.rhombus] % ConTEXt
+\usepackage{tikzfill.rhombus} % LATEX (secondary choice)
+\end{dispListing*}
+
+Based on |patterns.meta|, this library defines new rhombus patterns to fill graphs.
+
+%-------------------------------------------------------------------------------
+\subsection{Rhombus}
+The \docValue{rhombus} pattern draws rhombi or diamonds. The rhombi may be
+filled or outlined and can be arranged in different \emph{bands}, called band 0, band 1, and band 2.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern = { rhombus
+ [
+ size = 8mm, angle = 15
+ ]},
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+
+
+\begin{docTikzKey}{pattern rhombus}{=\marg{pattern keys}}{style, no default}
+ Convenience shortcut for setting the pattern to \docValue{rhombus}:
+\begin{dispListing}
+ pattern = { rhombus [ ... ] }
+\end{dispListing}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ size = 8mm, angle = 15
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docTikzKey}
+
+
+\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |10mm|}
+ The given \meta{size} denotes the length of an edge of one rhombical tile
+ where the (possibly smaller) rhombus is located in.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ size = 5mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+\clearpage
+
+\begin{docPatternKey}{fill}{}{no value, initially set}
+ Sets the rhombi to be filled. |fill| and |draw| are mutually exclusionary.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ fill,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{draw}{}{no value, initially unset}
+ Sets the rhombi to be outlined. |fill| and |draw| are mutually exclusionary.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ draw,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|}
+ Sets the \meta{length} value of the line width. This is only relevant, if
+ the rhombi are not filled.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ line width = 1mm, draw
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |-40|}
+ The pattern is rotated by the given \meta{angle}.
+ \par
+ Note that for \docValue*{rhombus} is valid, that a pattern is rotated first and shifted afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ angle = 15,
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+\clearpage
+
+\begin{docPatternKeys}
+ {
+ {
+ doc name = xshift,
+ doc parameter = {=\meta{xshift}},
+ doc description = {no default, initially |0pt|}
+ },
+ {
+ doc name = yshift,
+ doc parameter = {=\meta{yshift}},
+ doc description = {no default, initially |0pt|}
+ }
+ }
+ The pattern is shifted by \meta{xshift} and \meta{yshift}.
+ \par
+ Note that for \docValue*{rhombus} is valid, that a pattern is rotated first and shifted afterwards.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction={pattern rhombus, pattern color=blue},
+ pattern rhombus =
+ {
+ xshift=3mm, yshift=1mm,
+ },
+ pattern color=red
+ ]
+ (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKeys}
+
+
+
+\begin{docPatternKey}{ratio}{=\meta{value}}{no default, initially |2|}
+ Sets the \meta{value} of the ratio
+ between the longer diagonal and the shorter diagonal.
+ Therefore, $\text{\meta{value}}\ge 1$.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ pattern rhombus =
+ {
+ ratio = 4
+ },
+ pattern color=red
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+
+
+\begin{docPatternKey}{pos}{=\meta{value}}{no default, initially |1|}
+ Sets the edge position with a \meta{value} between 0 and 1, where $0$ is
+ the center and $1$ the outer rim of the rhombical tile.
+
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction={ pattern rhombus={pos=1},
+ pattern color=blue },
+ preaction={ pattern rhombus={pos=0.8},
+ pattern color=blue!80!red },
+ preaction={ pattern rhombus={pos=0.6},
+ pattern color=blue!60!red },
+ preaction={ pattern rhombus={pos=0.4},
+ pattern color=blue!40!red },
+ pattern rhombus={pos=0.2},
+ pattern color=blue!20!red,
+ ]
+(0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+\clearpage
+
+
+\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|}
+ \meta{number} can take 0, 1, or 2.
+ Here, 0 and 1 denote one of two different bands of the pattern,
+ while 2 denotes the comination of both.
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
+\begin{tikzpicture}
+\draw[
+ preaction = {
+ pattern rhombus = {
+ pos = 0.8, band = 0 },
+ pattern color=red },
+ pattern rhombus = {
+ pos = 0.8, band = 1
+ },
+ pattern color=blue
+ ] (0,0) rectangle (4,4);
+\end{tikzpicture}
+
+\begin{tikzpicture}
+\draw[
+ pattern rhombus = {
+ pos = 0.8, band = 2
+ },
+ pattern color=red
+ ] (0,0) rectangle (4,4);
+\end{tikzpicture}
+\end{dispExample*}
+\end{docPatternKey}
+
+\clearpage
+
+\printindex
+
+\end{document}
diff --git a/graphics/pgf/contrib/tikzfill/tikzlibraryfill.hexagon.code.tex b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.hexagon.code.tex
new file mode 100644
index 0000000000..2fccee15b9
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.hexagon.code.tex
@@ -0,0 +1,315 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzlibraryfill.hexagon.code.tex: filling with hexagon patterns
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesFile{tikzlibraryfill.hexagon.code.tex}[2022/07/20 v1.0.0 Hexagon pattern library]
+
+\usetikzlibrary{patterns.meta}
+
+\ExplSyntaxOn
+
+\int_new:N \l__tikzfill_hex_ring_int
+\tl_new:N \l__tikzfill_hex_a_tl
+\tl_new:N \l__tikzfill_hex_as_tl
+\tl_new:N \l__tikzfill_hex_b_tl
+\tl_new:N \l__tikzfill_hex_bs_tl
+\tl_new:N \l__tikzfill_hex_linewidth_tl
+\tl_new:N \l__tikzfill_hex_pos_tl
+
+\pgfdeclarepattern
+ {
+ name = hexagon~grid,
+ parameters =
+ {
+ \pgfkeysvalueof{/pgf/pattern~keys/size},
+ \pgfkeysvalueof{/pgf/pattern~keys/angle},
+ \pgfkeysvalueof{/pgf/pattern~keys/xshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/yshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/line~width},
+ },
+ defaults =
+ {
+ size /.initial = 8mm,
+ angle /.initial = 0,
+ line~width /.initial = 0.4pt,
+ xshift /.initial = 0pt,
+ yshift /.initial = 0pt,
+ },
+ set~up~code =
+ {
+ \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} }
+ \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp }
+ \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } }
+ \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } }
+ },
+ bottom~left =
+ {
+ \pgfpoint{ -\l__tikzfill_hex_b_tl-.1pt }{ -\l__tikzfill_hex_a_tl-\l__tikzfill_hex_linewidth_tl }
+ },
+ top~right =
+ {
+ \pgfpoint{ \l__tikzfill_hex_b_tl+.1pt }{ 2*\l__tikzfill_hex_a_tl+.1pt }
+ },
+ tile~size =
+ {
+ \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl }
+ },
+ tile~transformation =
+ {
+ \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} }
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift} }
+ }
+ },
+ code=
+ {
+ \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl}
+ \pgfpathmoveto{\pgfpoint{ 0 }{ 2*\l__tikzfill_hex_a_tl+.1pt }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ \l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_b_tl }{ 0.5*\l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_b_tl }{ -0.5*\l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_b_tl }{ -0.5*\l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_b_tl }{ 0.5*\l__tikzfill_hex_a_tl }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ \l__tikzfill_hex_a_tl }}
+ \pgfusepath{stroke}
+ }
+ }
+
+\tikzset{
+ pattern~hexagon~grid /.style =
+ {
+ pattern={hexagon~grid[#1]}
+ }
+}
+
+
+
+\pgfdeclarepattern
+ {
+ name = hexagon,
+ parameters =
+ {
+ \pgfkeysvalueof{/pgf/pattern~keys/size},
+ \pgfkeysvalueof{/pgf/pattern~keys/angle},
+ \pgfkeysvalueof{/pgf/pattern~keys/xshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/yshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/line~width},
+ \pgfkeysvalueof{/pgf/pattern~keys/pos},
+ \pgfkeysvalueof{/pgf/pattern~keys/band},
+ \pgfkeysvalueof{/pgf/pattern~keys/_fill_},
+ },
+ defaults =
+ {
+ size /.initial = 8mm,
+ angle /.initial = 0,
+ xshift /.initial = 0pt,
+ yshift /.initial = 0pt,
+ line~width /.initial = 0.4pt,
+ pos /.initial = 0.8,
+ band /.initial = 0,
+ _fill_ /.initial = 1,
+ fill /.style = { _fill_=1 },
+ draw /.style = { _fill_=0 },
+ },
+ set~up~code =
+ {
+ \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} }
+ \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp }
+ \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } }
+ \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } }
+ \tl_set:Nx \l__tikzfill_hex_pos_tl { \fp_to_decimal:n { min ( 1 , max( 0, \pgfkeysvalueof{/pgf/pattern~keys/pos} )) } }
+ },
+ bottom~left =
+ {
+ \pgfpoint{ -\l__tikzfill_hex_b_tl-\l__tikzfill_hex_linewidth_tl }{ -\l__tikzfill_hex_a_tl-\l__tikzfill_hex_linewidth_tl }
+ },
+ top~right =
+ {
+ \pgfpoint{ \l__tikzfill_hex_b_tl+\l__tikzfill_hex_linewidth_tl }{ 2*\l__tikzfill_hex_a_tl+\l__tikzfill_hex_linewidth_tl }
+ },
+ tile~size =
+ {
+ \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl }
+ },
+ tile~transformation =
+ {
+ \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} }
+ \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/band} } = 0
+ {
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift} }
+ }
+ }
+ {
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift}-\l__tikzfill_hex_b_tl }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift}+1.5*\l__tikzfill_hex_a_tl }
+ }
+ }
+ },
+ code=
+ {
+ \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } }
+ \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } }
+ \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathclose
+ \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/_fill_} } = 1
+ {
+ \pgfusepath{fill}
+ }
+ {
+ \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl}
+ \pgfusepath{stroke}
+ }
+ }
+ }
+
+
+\tikzset{
+ pattern~hexagon /.style =
+ {
+ preaction={pattern={hexagon[#1,band=1]}},
+ pattern={hexagon[#1,band=0]}
+ }
+}
+
+
+
+\pgfdeclarepattern
+ {
+ name = hexagon~cycle,
+ parameters =
+ {
+ \pgfkeysvalueof{/pgf/pattern~keys/size},
+ \pgfkeysvalueof{/pgf/pattern~keys/angle},
+ \pgfkeysvalueof{/pgf/pattern~keys/xshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/yshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/rings},
+ \pgfkeysvalueof{/pgf/pattern~keys/gap},
+ \pgfkeysvalueof{/pgf/pattern~keys/band},
+ },
+ defaults =
+ {
+ size /.initial = 8mm,
+ angle /.initial = 0,
+ xshift /.initial = 0pt,
+ yshift /.initial = 0pt,
+ rings /.initial = 3,
+ gap /.initial = 1,
+ band /.initial = 0,
+ },
+ set~up~code =
+ {
+ \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} }
+ \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp }
+ \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } }
+ \int_set:Nn \l__tikzfill_hex_ring_int { \fp_to_int:n { max ( 0, \pgfkeysvalueof{/pgf/pattern~keys/rings} ) }}
+ \fp_set:Nn \l_tmpa_fp { max ( 0.01, \pgfkeysvalueof{/pgf/pattern~keys/gap} ) }
+ \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n
+ {
+ \l__tikzfill_hex_b_tl / (( \l__tikzfill_hex_ring_int + 0.5 )*( 1 + \l_tmpa_fp ))
+ }}
+ },
+ bottom~left =
+ {
+ \pgfpoint{ -\l__tikzfill_hex_b_tl }{ -\l__tikzfill_hex_a_tl }
+ },
+ top~right =
+ {
+ \pgfpoint{ \l__tikzfill_hex_b_tl }{ 2*\l__tikzfill_hex_a_tl }
+ },
+ tile~size =
+ {
+ \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl }
+ },
+ tile~transformation =
+ {
+ \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} }
+ \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/band} } = 0
+ {
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift} }
+ }
+ }
+ {
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift}-\l__tikzfill_hex_b_tl }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift}+1.5*\l__tikzfill_hex_a_tl }
+ }
+ }
+ },
+ code=
+ {
+ \tl_set:Nn \l__tikzfill_hex_pos_tl { \l__tikzfill_hex_linewidth_tl/2/\l__tikzfill_hex_b_tl }
+ \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } }
+ \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } }
+ \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathclose
+ \pgfusepath{fill}
+ %
+ \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl}
+ \int_step_function:nN { \l__tikzfill_hex_ring_int } \__tikzfill_hex_draw_ring:n
+ }
+ }
+
+
+\cs_set:Npn \__tikzfill_hex_draw_ring:n #1
+ {
+ \tl_set:Nn \l__tikzfill_hex_pos_tl { #1/( \l__tikzfill_hex_ring_int + 0.5 )}
+ \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } }
+ \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } }
+ \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }}
+ \pgfpathclose
+ \pgfusepath{stroke}
+ }
+
+
+\tikzset{
+ pattern~hexagon~cycle /.style =
+ {
+ preaction={pattern={hexagon~cycle[#1,band=1]}},
+ pattern={hexagon~cycle[#1,band=0]}%
+ }
+}
+
+
+\ExplSyntaxOff
diff --git a/graphics/pgf/contrib/tikzfill/tikzlibraryfill.image.code.tex b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.image.code.tex
new file mode 100644
index 0000000000..ed20d0e780
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.image.code.tex
@@ -0,0 +1,400 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzlibraryfill.image.code.tex: filling with images
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesFile{tikzlibraryfill.image.code.tex}[2022/07/20 v1.0.0 Image filling library]
+
+\ExplSyntaxOn
+
+\box_new:N \l__tikzfill_img_box
+
+\tl_new:N \l__tikzfill_img_xa_tl
+\tl_new:N \l__tikzfill_img_xb_tl
+\tl_new:N \l__tikzfill_img_ya_tl
+\tl_new:N \l__tikzfill_img_yb_tl
+\tl_new:N \l__tikzfill_img_xc_tl
+\tl_new:N \l__tikzfill_img_yc_tl
+\tl_new:N \l__tikzfill_img_width_tl
+\tl_new:N \l__tikzfill_img_height_tl
+
+\tl_new:N \l__tikzfill_img_opacity_tl
+\tl_new:N \l__tikzfill_img_scale_tl
+\tl_new:N \l__tikzfill_img_graphics_options_tl
+
+\fp_new:N \l__tikzfill_img_scale_x_fp
+\fp_new:N \l__tikzfill_img_scale_y_fp
+
+
+\cs_new_nopar:Npn \__tikzfill_img_process_ppbb:
+ {
+ \pgf@process{\pgfpointanchor{path~picture~bounding~box}{south~west}}
+ \tl_set:Nx \l__tikzfill_img_xa_tl { \dim_eval:n { \pgf@x } }
+ \tl_set:Nx \l__tikzfill_img_ya_tl { \dim_eval:n { \pgf@y } }
+ \pgf@process{\pgfpointanchor{path~picture~bounding~box}{north~east}}
+ \tl_set:Nx \l__tikzfill_img_xb_tl { \dim_eval:n { \pgf@x } }
+ \tl_set:Nx \l__tikzfill_img_yb_tl { \dim_eval:n { \pgf@y } }
+ \tl_set:Nx \l__tikzfill_img_width_tl { \dim_eval:n { \pgf@x - \l__tikzfill_img_xa_tl } }
+ \tl_set:Nx \l__tikzfill_img_height_tl { \dim_eval:n { \pgf@y - \l__tikzfill_img_ya_tl } }
+ \pgfsetfillopacity{\l__tikzfill_img_opacity_tl}
+ \pgfsetstrokeopacity{\l__tikzfill_img_opacity_tl}
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_path_picture:n #1
+ {
+ \pgfkeysalso
+ {
+ path~picture =
+ {
+ \__tikzfill_img_process_ppbb:
+ #1
+ }
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_draw_textbox:n #1
+ {
+ \pgftext
+ [
+ x = \dim_eval:n { \l__tikzfill_img_xa_tl + \l__tikzfill_img_width_tl/2 },
+ y = \dim_eval:n { \l__tikzfill_img_ya_tl + \l__tikzfill_img_height_tl/2 }
+ ]{ #1 }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_include_graphics:n #1
+ {
+ \tl_set_eq:NN \l_tmpa_tl \l__tikzfill_img_graphics_options_tl
+ \tl_if_empty:NTF \l_tmpa_tl
+ {
+ \tl_set:Nn \l_tmpa_tl { \includegraphics }
+ }
+ {
+ \tl_put_left:Nn \l_tmpa_tl { \includegraphics[ }
+ \tl_put_right:Nn \l_tmpa_tl { ] }
+ }
+ \l_tmpa_tl { #1 }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_set_box_to_image:n #1
+ {
+ \hbox_set:Nn \l__tikzfill_img_box
+ {
+ \pgfinterruptpicture
+ \group_begin:
+ \__tikzfill_img_include_graphics:n { #1 }
+ \group_end:
+ \endpgfinterruptpicture
+ }
+ }
+
+
+
+\cs_new_nopar:Npn \__tikzfill_img_set_box_to_picture:n #1
+ {
+ \hbox_set:Nn \l__tikzfill_img_box
+ {
+ \pgfinterruptpicture
+ \group_begin:
+ \pgfsetbaseline{0pt}
+ \tikzpicture#1\endtikzpicture
+ \group_end:
+ \endpgfinterruptpicture
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_draw_box:
+ {
+ \__tikzfill_img_draw_textbox:n
+ {
+ \box_use_drop:N \l__tikzfill_img_box
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_stretch_draw_box:
+ {
+ \box_resize_to_wd_and_ht_plus_dp:Nnn \l__tikzfill_img_box
+ { \fp_to_dim:n { \l__tikzfill_img_scale_tl*\l__tikzfill_img_width_tl }}
+ { \fp_to_dim:n { \l__tikzfill_img_scale_tl*\l__tikzfill_img_height_tl }}
+ \__tikzfill_img_draw_box:
+ }
+
+
+\cs_new_nopar:Npn \xxxx__tikzfill_img_compute_scales:
+ {
+ \fp_set:Nn \l_tmpa_fl { \box_wd:N \l__tikzfill_img_box }
+ \fp_compare:nNnTF \l_tmpa_fl < {1pt}
+ {
+ \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp
+ }
+ {
+ \fp_set:Nn \l__tikzfill_img_scale_x_fp
+ {
+ \l__tikzfill_img_scale_tl*\l__tikzfill_img_width_tl / \l_tmpa_fl
+ }
+ }
+ \fp_set:Nn \l_tmpb_fl { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box }
+ \fp_compare:nNnTF \l_tmpb_fl < {1pt}
+ {
+ \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp
+ }
+ {
+ \fp_set:Nn \l__tikzfill_img_scale_y_fp
+ {
+ \l__tikzfill_img_scale_tl*\l__tikzfill_img_height_tl / \l_tmpb_fl
+ }
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_compute_scales:
+ {
+ \dim_set:Nn \l_tmpa_dim { \box_wd:N \l__tikzfill_img_box }
+ \dim_compare:nNnTF \l_tmpa_dim < {1pt}
+ {
+ \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp
+ }
+ {
+ \fp_set:Nn \l__tikzfill_img_scale_x_fp
+ {
+ \l__tikzfill_img_scale_tl * \l__tikzfill_img_width_tl / \l_tmpa_dim
+ }
+ }
+ \dim_set:Nn \l_tmpb_dim { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box }
+ \dim_compare:nNnTF \l_tmpb_dim < {1pt}
+ {
+ \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp
+ }
+ {
+ \fp_set:Nn \l__tikzfill_img_scale_y_fp
+ {
+ \l__tikzfill_img_scale_tl * \l__tikzfill_img_height_tl / \l_tmpb_dim
+ }
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_scale_draw_box:
+ {
+ \box_scale:Nnn \l__tikzfill_img_box
+ { \fp_to_dim:N \l__tikzfill_img_scale_x_fp }
+ { \fp_to_dim:N \l__tikzfill_img_scale_y_fp }
+ \__tikzfill_img_draw_box:
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_overzoom_draw_box:
+ {
+ \__tikzfill_img_compute_scales:
+ \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp
+ { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp }
+ { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp }
+ \__tikzfill_img_scale_draw_box:
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_zoom_draw_box:
+ {
+ \__tikzfill_img_compute_scales:
+ \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp
+ { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp }
+ { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp }
+ \__tikzfill_img_scale_draw_box:
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_shrink_draw_box:
+ {
+ \__tikzfill_img_compute_scales:
+ \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp
+ { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp }
+ { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp }
+ \fp_compare:nNnT \l__tikzfill_img_scale_x_fp > 1
+ {
+ \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp
+ \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp
+ }
+ \__tikzfill_img_scale_draw_box:
+ }
+
+
+\cs_new_nopar:Npn \__tikzfill_img_tile_draw_box:
+ {
+ \dim_set:Nn \l_tmpa_dim { \box_wd:N \l__tikzfill_img_box }
+ \dim_set:Nn \l_tmpb_dim { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box }
+ \dim_set:Nn \l_tmpb_dim { -\l_tmpb_dim }
+
+ \dim_step_variable:nnnNn
+ { \l__tikzfill_img_xa_tl }
+ { \l_tmpa_dim }
+ { \l__tikzfill_img_xb_tl }
+ \l__tikzfill_img_xc_tl
+ {
+ \dim_step_variable:nnnNn
+ { \l__tikzfill_img_yb_tl }
+ { \l_tmpb_dim }
+ { \l__tikzfill_img_ya_tl }
+ \l__tikzfill_img_yc_tl
+ {
+ \pgftext
+ [
+ x = \l__tikzfill_img_xc_tl,
+ y = \l__tikzfill_img_yc_tl,
+ left,
+ top
+ ]
+ { \box_use:N\l__tikzfill_img_box }
+ }
+ }
+ }
+
+
+\tikzset
+ {
+ fill~image~opacity/.store~in=\l__tikzfill_img_opacity_tl,
+ fill~image~opacity=1,
+ fill~image~scale/.store~in=\l__tikzfill_img_scale_tl,
+ fill~image~scale=1,
+ fill~image~options/.store~in=\l__tikzfill_img_graphics_options_tl,
+ fill~image~options=,
+ fill~plain~image/.code=
+ {
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_draw_textbox:n
+ {
+ \__tikzfill_img_include_graphics:n { #1 }
+ }
+ }
+ },
+ fill~plain~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_draw_box:
+ }
+ },
+ fill~stretch~image/.code=
+ {
+ \__tikzfill_img_set_box_to_image:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_stretch_draw_box:
+ }
+ },
+ fill~stretch~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_stretch_draw_box:
+ }
+ },
+ fill~overzoom~image/.code=
+ {
+ \__tikzfill_img_set_box_to_image:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_overzoom_draw_box:
+ }
+ },
+ fill~overzoom~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_overzoom_draw_box:
+ }
+ },
+ fill~zoom~image/.code=
+ {
+ \__tikzfill_img_set_box_to_image:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_zoom_draw_box:
+ }
+ },
+ fill~zoom~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_zoom_draw_box:
+ }
+ },
+ fill~shrink~image/.code=
+ {
+ \__tikzfill_img_set_box_to_image:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_shrink_draw_box:
+ }
+ },
+ fill~shrink~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_shrink_draw_box:
+ }
+ },
+ fill~tile~image/.code=
+ {
+ \__tikzfill_img_set_box_to_image:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_tile_draw_box:
+ }
+ },
+ fill~tile~picture/.code=
+ {
+ \__tikzfill_img_set_box_to_picture:n { #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_tile_draw_box:
+ }
+ },
+ fill~tile~picture*/.code~n~args={2}
+ {
+ \__tikzfill_img_set_box_to_picture:n { #2 }
+ \box_scale:Nnn \l__tikzfill_img_box { #1 }{ #1 }
+ \__tikzfill_img_path_picture:n
+ {
+ \__tikzfill_img_tile_draw_box:
+ }
+ },
+ }
+
+
+\ExplSyntaxOff
+
+\tikzset
+ {
+ fill plain image*/.style n args={2}{fill image options={#1},fill plain image={#2}},%
+ fill stretch image*/.style n args={2}{fill image options={#1},fill stretch image={#2}},%
+ fill overzoom image*/.style n args={2}{fill image options={#1},fill overzoom image={#2}},%
+ fill zoom image*/.style n args={2}{fill image options={#1},fill zoom image={#2}},%
+ fill shrink image*/.style n args={2}{fill image options={#1},fill shrink image={#2}},%
+ fill tile image*/.style n args={2}{fill image options={#1},fill tile image={#2}},%
+ }
+
diff --git a/graphics/pgf/contrib/tikzfill/tikzlibraryfill.rhombus.code.tex b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.rhombus.code.tex
new file mode 100644
index 0000000000..e425470c44
--- /dev/null
+++ b/graphics/pgf/contrib/tikzfill/tikzlibraryfill.rhombus.code.tex
@@ -0,0 +1,159 @@
+%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20)
+%% tikzlibraryfill.rhombus.code.tex: filling with rhombus patterns
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% -------------------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README.md
+%%
+\ProvidesFile{tikzlibraryfill.rhombus.code.tex}[2022/07/15 v0.0.1 Rhombus pattern library]
+
+\usetikzlibrary{patterns.meta}
+
+\ExplSyntaxOn
+
+\fp_new:N \l__tikzfill_rho_angle_fp
+\fp_new:N \l__tikzfill_rho_d_fp
+\fp_new:N \l__tikzfill_rho_s_fp
+
+\tl_new:N \l__tikzfill_rho_dsize_tl
+\tl_new:N \l__tikzfill_rho_linewidth_tl
+\tl_new:N \l__tikzfill_rho_matrix_a_tl
+\tl_new:N \l__tikzfill_rho_matrix_b_tl
+\tl_new:N \l__tikzfill_rho_matrix_c_tl
+\tl_new:N \l__tikzfill_rho_matrix_d_tl
+\tl_new:N \l__tikzfill_rho_poffset_tl
+\tl_new:N \l__tikzfill_rho_psize_tl
+\tl_new:N \l__tikzfill_rho_size_tl
+
+
+\pgfdeclarepattern
+ {
+ name = rhombus,
+ parameters =
+ {
+ \pgfkeysvalueof{/pgf/pattern~keys/size},
+ \pgfkeysvalueof{/pgf/pattern~keys/angle},
+ \pgfkeysvalueof{/pgf/pattern~keys/ratio},
+ \pgfkeysvalueof{/pgf/pattern~keys/xshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/yshift},
+ \pgfkeysvalueof{/pgf/pattern~keys/line~width},
+ \pgfkeysvalueof{/pgf/pattern~keys/pos},
+ \pgfkeysvalueof{/pgf/pattern~keys/band},
+ \pgfkeysvalueof{/pgf/pattern~keys/_fill_},
+ },
+ defaults =
+ {
+ size /.initial = 10mm,
+ angle /.initial = -40,
+ ratio /.initial = 2,
+ xshift /.initial = 0pt,
+ yshift /.initial = 0pt,
+ line~width /.initial = 0.4pt,
+ pos /.initial = 1,
+ band /.initial = 0,
+ _fill_ /.initial = 1,
+ fill /.style = { _fill_=1 },
+ draw /.style = { _fill_=0 },
+ },
+ set~up~code =
+ {
+ \tl_set:Nx \l__tikzfill_rho_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } }
+
+ \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} }
+ \tl_set:Nx \l__tikzfill_rho_size_tl { \fp_to_dim:N \l_tmpa_fp }
+ \tl_set:Nx \l__tikzfill_rho_dsize_tl { \fp_to_dim:n { 2 * \l_tmpa_fp } }
+
+ \fp_set:Nn \l_tmpb_fp { min ( 1, max( 0, \pgfkeysvalueof{/pgf/pattern~keys/pos} )) }
+ \tl_set:Nx \l__tikzfill_rho_psize_tl { \fp_to_dim:n { \l_tmpa_fp * \l_tmpb_fp } }
+ \tl_set:Nx \l__tikzfill_rho_poffset_tl { \fp_to_dim:n { \l_tmpa_fp * (1-\l_tmpb_fp)/2 } }
+
+ \fp_set:Nn \l__tikzfill_rho_angle_fp { \pgfkeysvalueof{/pgf/pattern~keys/angle} }
+
+ \fp_set:Nn \l_tmpa_fp { max( 1 , \pgfkeysvalueof{/pgf/pattern~keys/ratio} ) }
+ \fp_set:Nn \l_tmpa_fp { \l_tmpa_fp*\l_tmpa_fp }
+ \fp_set:Nn \l__tikzfill_rho_s_fp{ (\l_tmpa_fp-1)/(\l_tmpa_fp+1) }
+
+ \fp_set:Nn \l__tikzfill_rho_d_fp { sqrt( 1 - \l__tikzfill_rho_s_fp * \l__tikzfill_rho_s_fp ) }
+ \fp_set:Nn \l_tmpb_fp
+ {
+ \l__tikzfill_rho_angle_fp - atand( \l__tikzfill_rho_d_fp / ( 1 + \l__tikzfill_rho_s_fp ) )
+ }
+ \fp_set:Nn \l_tmpa_fp { cosd(\l_tmpb_fp) }
+ \fp_set:Nn \l_tmpb_fp { sind(\l_tmpb_fp) }
+
+ \tl_set:Nx \l__tikzfill_rho_matrix_a_tl { \fp_to_decimal:N \l_tmpa_fp }
+ \tl_set:Nx \l__tikzfill_rho_matrix_b_tl { \fp_to_decimal:N \l_tmpb_fp }
+ \tl_set:Nx \l__tikzfill_rho_matrix_c_tl { \fp_to_decimal:n
+ {
+ \l__tikzfill_rho_s_fp * \l_tmpa_fp - \l__tikzfill_rho_d_fp * \l_tmpb_fp
+ }}
+ \tl_set:Nx \l__tikzfill_rho_matrix_d_tl { \fp_to_decimal:n
+ {
+ \l__tikzfill_rho_s_fp * \l_tmpb_fp + \l__tikzfill_rho_d_fp * \l_tmpa_fp
+ }}
+ },
+ bottom~left = { \pgfpoint{-\l__tikzfill_rho_linewidth_tl}{-\l__tikzfill_rho_linewidth_tl} },
+ top~right = { \pgfpoint{\l__tikzfill_rho_dsize_tl+\l__tikzfill_rho_linewidth_tl}
+ {\l__tikzfill_rho_dsize_tl+\l__tikzfill_rho_linewidth_tl} },
+ tile~size = { \pgfqpoint{\l__tikzfill_rho_dsize_tl}{\l__tikzfill_rho_dsize_tl} },
+ tile~transformation =
+ {
+ \pgftransformshift
+ {
+ \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} }
+ { \pgfkeysvalueof{/pgf/pattern~keys/yshift} }
+ }
+ \pgftransformcm{\l__tikzfill_rho_matrix_a_tl}{\l__tikzfill_rho_matrix_b_tl}
+ {\l__tikzfill_rho_matrix_c_tl}{\l__tikzfill_rho_matrix_d_tl}
+ {\pgfpointorigin}
+ },
+ code =
+ {
+ \int_set:Nn \l_tmpa_int { \pgfkeysvalueof{/pgf/pattern~keys/band} }
+ \int_compare:nNnF \l_tmpa_int = 1
+ {
+ \pgfpathrectangle{\pgfqpoint{\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_poffset_tl}}
+ {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}}
+ \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}}
+ {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}}
+ }
+ \int_compare:nNnT \l_tmpa_int > 0
+ {
+ \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}}
+ {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}}
+ \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_poffset_tl}}
+ {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}}
+ }
+ \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/_fill_} } = 1
+ {
+ \pgfusepath{fill}
+ }
+ {
+ \pgfsetlinewidth{\l__tikzfill_rho_linewidth_tl}
+ \pgfusepath{draw}
+ }
+ }
+ }
+
+
+\tikzset{
+ pattern~rhombus /.style =
+ {
+ pattern={rhombus[#1]}
+ }
+}
+
+
+\ExplSyntaxOff