From f141795725a2d10b5818b0bf13c51c3d630cb99b Mon Sep 17 00:00:00 2001 From: Thomas Pietrzak Date: Mon, 13 Sep 2021 15:48:36 +0200 Subject: [PATCH] Side project: the gears! --- tex/old/gears.tex | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tex/old/gears.tex diff --git a/tex/old/gears.tex b/tex/old/gears.tex new file mode 100644 index 0000000..32a50c9 --- /dev/null +++ b/tex/old/gears.tex @@ -0,0 +1,29 @@ +%!TEX root = ../../hdrmain.tex + +\begin{figure}[htb] + \definecolor{cellblue}{rgb} {0.17,0.60,0.99} + \definecolor{cellred}{rgb} {0.98,0.17,0.15} + \def\scale{1mm} + % posx posy r1 r2 ad n color + \newcommand{\gear}[7]{ + \pgfmathsetmacro{\nn}{360/#6} + \begin{scope}[xshift=#1, yshift=#2] + \foreach \i in {1,...,{#6}} + { + \pgfmathsetmacro{\a}{\i*\nn} + \pgfmathsetmacro{\b}{\i*\nn+\nn/2} + \fill[x=\scale, y=\scale, #7] (\a-#5:#4) -- (\a+#5:#3) arc[start angle=\a+#5, end angle=\b-#5, radius=#3] -- (\b+#5:#4) -- cycle; + \fill[x=\scale, y=\scale, #7] (0,0) circle (#4); + } + \end{scope} + } + \tikzexternalenable + \begin{tikzpicture} + \gear{0}{0}{8mm}{6mm}{3}{12}{cellblue} + \gear{35}{10}{6mm}{4mm}{3}{10}{cellred} + \end{tikzpicture} + \tikzexternaldisable + \caption[]{} + \label{fig:stimtacpatterns} +\end{figure} +\newpage -- 2.30.2