4

Consider the following MWE:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
   \path[draw] (1,0) circle (1) (1.7,1.2);
   \path[draw] (.5,-1) circle (1) (0.5,-2.2);
   \path[clip] (.5,-1) circle (1) (0.5,-2.2);
   \path[clip] (1,0) circle (1) (1.7,1.2);
   \path[fill=white] (.5,-1) circle (1) (0.5,-2.2);
%  \path[draw] (1,0) circle (1) (1.7,1.2);
%  \path[draw] (.5,-1) circle (1) (0.5,-2.2);  add the commented lines to get the desired output
\end{tikzpicture}
\end{document}

enter image description here

Is it possible to take the line width into account when filling the clipped region so that the border of the filled area is not thinner but keeps the original width?

To achieve this result I do redraw both circles after the filling, but that sounds like a suboptimal solution to me.

1 Answer 1

6

You can use a scope to apply the clip only to the overlapping region, and then simply draw the two circles after filling the overlap:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \begin{scope}
        \path[clip] (.5,-1) circle (1) (0.5,-2.2);
        \path[clip] (1,0) circle (1) (1.7,1.2);
        \path[fill=orange] (.5,-1) circle (1) (0.5,-2.2);
    \end{scope}
    \path[draw] (1,0) circle (1) (1.7,1.2);
    \path[draw] (.5,-1) circle (1) (0.5,-2.2);
\end{tikzpicture}
\end{document}
1
  • Of course, there was no need to draw the circles before the clipping, thank you!
    – d-cmst
    Dec 21, 2013 at 16:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .