編輯

編輯

這是一個範例文件以及我從中得到的輸出。

\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命令 at (*),則結果如下。

答案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}

相關內容