0

I used the following code from the answer to this question

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Spirifankerln using scale}
\begin{tikzpicture}[pics/spiro/.style={code={
 \draw[line width=.1cm,looseness=1,pic actions]
  (0,-2) foreach \X in {0,90,180,270}
  {[rotate=\X]
 -- (0,-2)% node {1}
 to[out=0,in=-90] ++ (0.2,0.1)% node {2}
 to[out=90,in=-180] ++ (1.7,1.7)% node {3}
 to[out=0,in=-90] ++ (0.1,0.2)% node[red] {4}
} -- cycle;}}]
\pic[draw=orange!100,fill=orange!40,scale=2, rotate=11.25]{spiro};
\pic[draw=orange!100,fill=orange!40,scale=2, rotate=-11.25]{spiro};
\pic[draw=orange!100,fill=orange!40,scale=2, rotate=33.75]{spiro};
\pic[draw=orange!100,fill=orange!40,scale=2, rotate=-33.75]{spiro};
\pic[draw=brown!100,fill=brown!40,scale=2, rotate=-22.5]{spiro};
\pic[draw=brown!100,fill=brown!40,scale=2, rotate=22.5]{spiro};
\pic[draw=red!100,fill=red!40,scale=2, rotate=45]{spiro};
\pic[draw=purple!100,fill=purple!40,scale=2]{spiro};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

How to simplify it, and how to make the corners spiky, resembling the following drawing.

enter image description here

Hany
  • 4,709
  • It seems that you did not understand the basic principle of TikZ, so you get stuck several times, and just ask many many questions. It is more efficient if you study pgfmanual carefully. Just ignore my advice if you don’t like! – Black Mild Dec 21 '19 at 09:13
  • 1
    @Black Mild Thank you for your advice. I am not good at programming, and unfortunately I have a limited time for studying pgf. I will try to spare sometime to take your advice. – Hany Dec 21 '19 at 14:09

1 Answers1

4

You just need to redraw the pic. As your colours don't really have a pattern, there is little to simplify.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Spirifankerln using scale}
\begin{tikzpicture}[pics/spiro/.style={code={
  \draw[line width=.1cm,looseness=1,pic actions]
    (0,-2) arc (180:90:2) arc (270:180:2) arc (360:270:2) arc (90:0:2);
  }
}]
  \foreach \i in {-33.75,-11.25,11.25,33.75}
    \pic[draw=orange!100,fill=orange!40,scale=2,rotate=\i]{spiro};
  \pic[draw=brown!100,fill=brown!40,scale=2, rotate=-22.5]{spiro};
  \pic[draw=brown!100,fill=brown!40,scale=2, rotate=22.5]{spiro};
  \pic[draw=red!100,fill=red!40,scale=2, rotate=45]{spiro};
  \pic[draw=purple!100,fill=purple!40,scale=2]{spiro};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

Add everything to a loop (note that the order matters!).

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Spirifankerln using scale}
\begin{tikzpicture}[pics/spiro/.style={code={
  \draw[line width=.1cm,looseness=1,pic actions]
    (0,-2) arc (180:90:2) arc (270:180:2) arc (360:270:2) arc (90:0:2);
  }
}]
  \foreach \i/\clr in {3/orange,1/orange,2/brown,4/red,0/purple} {
    \pic[draw/.expanded=\clr!100,fill/.expanded=\clr!40,scale=2,rotate=\i*11.25]{spiro};
    \pic[draw/.expanded=\clr!100,fill/.expanded=\clr!40,scale=2,rotate=-\i*11.25]{spiro};
  }
\end{tikzpicture}
\end{frame}
\end{document}

(same output as above)

fractal
  • 1,500