편집하다

편집하다

다음은 예제 문서와 그 문서에서 얻은 결과입니다.

\documentclass[convert={size=480}]{standalone}

\usepackage{tikz}

\tikzset{ little circle/.style = { fill = black,
                                   shape = circle,
                                   minimum size = 1.5mm,
                                   inner sep = 0mm,
                                   outer sep = 0mm},
          concentric circles/.style = {draw = gray!90, very thick}}

\begin{document}

\begin{tikzpicture}
    \def\concentriccircles{\foreach \r in {1.5, ..., 19} {circle (\r mm)};}
    \foreach \name/\x/\y in {A/8/30, B/16/-24, C/-30/8} {
        \node [little circle] (\name) at (\x mm, \y mm) {};
    }
    \node [little circle] (P) at (barycentric cs:A=1,B=1,C=1) {};
    \foreach \name/\origin/\destination in {H/A/B, J/B/C, K/C/A} {
        \path (\origin) -- (\destination) coordinate [midway] (\name);
        \path (P) -- (\name) node [pos = 1.6, little circle] (\name 2) {};
    }
    \draw [concentric circles] (P) \concentriccircles;
    \foreach \x/\y/\v/\c in {A/B/H/green, B/C/J/red, C/A/K/blue} {
        \begin{scope}
            \clip (\x) .. controls (P) .. (\y) -- (\v 2) -- (\x); % (*)
            \draw [concentric circles, draw = \c] (P) \concentriccircles;
        \end{scope}
    }
    \begin{scope}[very thick]
        \foreach \x/\y/\c in {A/B/red, B/C/blue, C/A/green} {
            \draw [\c] (\x) .. controls (P) .. (\y);
        }
    \end{scope}
    \begin{scope}[very thick, red]
        \path [use as bounding box];
        \clip (A) circle [radius = 25mm];
        \draw (A) .. controls (P) .. (B);
    \end{scope}
\end{tikzpicture}

\end{document}

왜 클리핑 영역에서 삼각형 (A, B, H2)( (B, C, J2)(C, A, K2))을 제외하는지 이해가 되지 않습니다. A와 B(B와 C, C와 A) 사이의 선 너머의 동심원이 여전히 회색이기 때문에 그렇게 되는 것을 볼 수 있습니다.

편집하다

의 명령 draw에 옵션을 추가하면 다음과 같습니다 .\clip(*)

답변1

노드로 경로를 구축하는 경우 TikZ는 노드의 내용을 피하기 위해 이 경로를 여러 세그먼트로 자릅니다.

닫힌 클리핑 경로를 만들려면 노드 대신 좌표를 사용하거나 , \x.center, \y.center\v 2.center을 사용하세요.

여기에 이미지 설명을 입력하세요

\documentclass[convert={size=480}]{standalone}

\usepackage{tikz}

\tikzset{ little circle/.style = { fill = black,
                                   shape = circle,
                                   minimum size = 1.5mm,
                                   inner sep = 0mm,
                                   outer sep = 0mm},
          concentric circles/.style = {draw = gray!90, very thick}}

\begin{document}

\begin{tikzpicture}
    \def\concentriccircles{\foreach \r in {1.5, ..., 19} {circle (\r mm)};}
    \foreach \name/\x/\y in {A/8/30, B/16/-24, C/-30/8} {
        \node [little circle] (\name) at (\x mm, \y mm) {};
    }
    \node [little circle] (P) at (barycentric cs:A=1,B=1,C=1) {};
    \foreach \name/\origin/\destination in {H/A/B, J/B/C, K/C/A} {
        \path (\origin) -- (\destination) coordinate [midway] (\name);
        \path (P) -- (\name) node [pos = 1.6, little circle] (\name 2) {};
    }
    \draw [concentric circles] (P) \concentriccircles;
    \foreach \x/\y/\v/\c in {A/B/H/green, B/C/J/red, C/A/K/blue} {
        \begin{scope}
            \clip (\x.center) .. controls (P.center) .. (\y.center)
            -- (\v 2.center) -- cycle; % (*)
            \draw [concentric circles, draw = \c] (P) \concentriccircles;
        \end{scope}
    }
    \begin{scope}[very thick]
        \foreach \x/\y/\c in {A/B/red, B/C/blue, C/A/green} {
            \draw [\c] (\x) .. controls (P) .. (\y);
        }
    \end{scope}
    \begin{scope}[very thick, red]
        \path [use as bounding box];
        \clip (A) circle [radius = 25mm];
        \draw (A) .. controls (P) .. (B);
    \end{scope}
\end{tikzpicture}

\end{document}

관련 정보