使用裁剪填充交叉点

使用裁剪填充交叉点

在此处输入图片描述我正在尝试获得与附图类似的东西,但是我没有得到所有交叉点的正确颜色,有什么帮助吗?

\documentclass[border=1mm]{standalone}
\usepackage{tikz}

\definecolor{CircleBlue}{RGB}{0, 163, 232}
\definecolor{CircleYellow}{RGB}{254, 242, 0}
\definecolor{CircleOrange}{RGB}{255, 127, 38}


\begin{document}
\begin{tikzpicture}
\draw (0cm,0cm) coordinate (RRH7) circle (4.5cm);
\draw (-6cm,0cm) coordinate (RRH1) circle (4.5cm);
\draw (-3cm,5.1962cm) coordinate (RRH6) circle (4.5cm);
\draw (3cm,5.1962cm) coordinate (RRH5) circle (4.5cm);
\draw (6cm,0cm) coordinate (RRH4) circle (4.5cm);
\draw (3cm,-5.1962cm) coordinate (RRH3) circle (4.5cm);
\draw (-3cm,-5.1962cm) coordinate (RRH2) circle (4.5cm);

\begin{scope}[radius=4.5cm]
    \def\Circles{
      (RRH1) circle[]
      (RRH2) circle[]
      (RRH3) circle[]
      (RRH4) circle[]
      (RRH5) circle[]
      (RRH6) circle[]
      (RRH7) circle[]
    }
   \fill[CircleBlue] \Circles;
    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH1) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH1) circle[];
    \end{scope}
    %%
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH4) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH4) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH4) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH3) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH2) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH6) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH6) circle[];
    \end{scope}
    \draw[very thick] \Circles;
    \end{scope}
\end{tikzpicture}
\end{document}

答案1

最后必须填充橙色。我还将定位更改为极坐标并重命名了形状。

编辑:进一步改进代码。您应该查看 \clip 文档。

\documentclass[border=1mm]{standalone}
\usepackage{tikz}

\definecolor{CircleBlue}{RGB}{0, 163, 232}
\definecolor{CircleYellow}{RGB}{254, 242, 0}
\definecolor{CircleOrange}{RGB}{255, 127, 38}


\begin{document}


\begin{tikzpicture}
\draw (0cm,0cm) coordinate (RRH7) circle (4.5cm);
\draw (0:6cm)   coordinate (RRH1) circle (4.5cm);
\draw (60:6cm)  coordinate (RRH2) circle (4.5cm);
\draw (120:6cm) coordinate (RRH3) circle (4.5cm);
\draw (180:6cm) coordinate (RRH4) circle (4.5cm);
\draw (240:6cm) coordinate (RRH5) circle (4.5cm);
\draw (300:6cm) coordinate (RRH6) circle (4.5cm);

\begin{scope}[radius=4.5cm]
    \def\Circles{
      (RRH1) circle[]
      (RRH2) circle[]
      (RRH3) circle[]
      (RRH4) circle[]
      (RRH5) circle[]
      (RRH6) circle[]
      (RRH7) circle[]
    }
   \fill[CircleBlue] \Circles;
    \begin{scope}
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH3) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH4) circle[];
    \end{scope}
    %%
    \begin{scope}
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \fill[CircleYellow] (RRH6) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH1) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH3) circle[];
      \clip (RRH4) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH4) circle[];
      \clip (RRH5) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH6) circle[];
      \clip (RRH1) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
    \draw[very thick] \Circles;
    \end{scope}
\end{tikzpicture}
\end{document}

相关内容