避免重复填充图纸

避免重复填充图纸

制作以下绘图

在此处输入图片描述

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

\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}

如何才能避免重复绘制的填充,产生均匀的填充

在此处输入图片描述

答案1

您可以将这transparency group三张图片包裹起来,并将其设置为blend groupwithlighten选项。这样填充就会均匀。不幸的是,您似乎仍然需要单独添加轮廓。

\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}

在此处输入图片描述

相关内容