Side project: the gears!
authorThomas Pietrzak <thomas.pietrzak@gmail.com>
Mon, 13 Sep 2021 13:48:36 +0000 (15:48 +0200)
committerThomas Pietrzak <thomas.pietrzak@gmail.com>
Mon, 13 Sep 2021 13:48:36 +0000 (15:48 +0200)
tex/old/gears.tex [new file with mode: 0644]

diff --git a/tex/old/gears.tex b/tex/old/gears.tex
new file mode 100644 (file)
index 0000000..32a50c9
--- /dev/null
@@ -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