
Hier ist ein Beispieldokument und die Ausgabe, die ich daraus erhalte.
\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}
Ich verstehe nicht, warum der Clipping-Bereich das Dreieck (A, B, H2)
( (B, C, J2)
und (C, A, K2)
) ausschließt. Das erkennt man daran, dass die konzentrischen Kreise jenseits der Linie zwischen A und B (B und C, C und A) immer noch grau sind.
Bearbeiten
So sieht es aus, wenn Sie draw
dem \clip
Befehl die Option bei hinzufügen (*)
.
Antwort1
Wenn Sie einen Pfad mit Knoten erstellen, schneidet TikZ diesen Pfad in mehrere Segmente, um den Inhalt der Knoten zu vermeiden.
Verwenden Sie zum Erstellen Ihres geschlossenen Beschneidungspfads Koordinaten statt Knoten ... oder verwenden Sie \x.center
, \y.center
, \v 2.center
, usw.
\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}