선을 가늘게 하지 않고 패스 채우기

선을 가늘게 하지 않고 패스 채우기

다음 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

a를 사용하여 겹치는 영역에만 scope적용한 다음 , 겹치는 부분을 채운 후 두 개의 원을 간단히 그릴 수 있습니다.clip

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

관련 정보