3

To produce the following drawing

enter image description here

I used the following code, from the answer to this question

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Spirograph 1}
\begin{tikzpicture}[pics/fcross/.style={code={
\begin{scope}[transparency group,opacity=.4, scale=2]
\draw[line width=.1cm,blue, fill=blue!40!white, looseness=1] 
(0,0) node {x} (0,-2) foreach \X in {0,90,180,270}
{[rotate=\X] -- (0,-2) to [out=0,in=-120] ++ (0.2,0.1) to [out=60,in=-150] ++ (1.7,1.7) to [out=30,in=-90] ++ (0.1,0.2)} -- cycle;
\end{scope}  
}}]
 \path foreach \Y in {0,30,60} {pic[rotate=\Y] {fcross}};
\end{tikzpicture}
\end{frame}
\end{document}

How can I avoid repeating the filling of the repeated drawing to produce a uniform filling

enter image description here

Hany
  • 4,709
  • Just out of curiosity, how did you make the second image without knowing the answer? – AlexG Dec 18 '19 at 07:47
  • 1
    @AlexG I took a screenshot, pasted it in paint, rotated it, and included it as a graphic in TexWorks before the tikzpicture. – Hany Dec 18 '19 at 08:12

1 Answers1

3

You can wrap the transparency group around all three pics, and make it a blend group with lighten option. This makes the fill uniform. Unfortunately, it seems that you still need to add the contour separately.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{rounded corners solution 1}
\begin{tikzpicture}[pics/fcross/.style={code={
\path[line width=.1cm,fill=blue!40!white, looseness=1,pic actions] 
(0,0) node {x} (0,-2) foreach \X in {0,90,180,270}
{[rotate=\X] -- (0,-2) to [out=0,in=-120] ++ (0.2,0.1) to [out=60,in=-150] ++ (1.7,1.7) to [out=30,in=-90] ++ (0.1,0.2)} -- cycle;
%\end{scope}
}}]
 \begin{scope}[blend group=lighten,fill opacity=.4]
  \path foreach \Y in {0,30,60} {pic[rotate=\Y,scale=2] {fcross}};
 \end{scope} 
 \path foreach \Y in {0,30,60} {pic[rotate=\Y,scale=2,fill=none,draw,blue!40] {fcross}};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here