避免绘制内部线条

避免绘制内部线条

制作以下绘图

在此处输入图片描述

我使用了以下代码,来自答案这个问题

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{Spirograph 1}
\begin{tikzpicture}[pics/fcross/.style={code={
\path[line width=.1cm,fill=blue!40!white, looseness=1,pic actions] 
(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}

如何才能避免显示重复绘图的内部线条,以产生以下绘图。

在此处输入图片描述

答案1

您本质上需要放出第二个循环。

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{rounded corners solution 1}
\begin{tikzpicture}[pics/fcross/.style={code={
\path[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;
}}]
 \begin{scope}[blend group=lighten,fill opacity=.4]
  \path foreach \Y in {0,30,60} {pic[rotate=\Y,scale=2,line width=.2cm,draw=blue] {fcross}};
 \end{scope} 
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

相关内容