
次の 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}
クリッピングされた領域を塗りつぶすときに線の幅を考慮して、塗りつぶされた領域の境界線が細くならず、元の幅が維持されるようにすることは可能ですか?
この結果を得るために、塗りつぶし後に両方の円を再描画しますが、これは最適ではない解決策のように思えます。
答え1
を使用して、重なり合う領域にのみscope
を適用しclip
、重なり合う部分を塗りつぶした後に 2 つの円を描くだけです。
\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}