我希望在双边经过 fl 和 hc 之间的所有地方时隐藏它(而不仅仅是在交点处)。我需要一个解决方案没有强迫我手动计算(f)和(h)处的斜率。
理想情况下,我希望能够“关闭”给定曲线两点之间的任何曲线绘制。
\documentclass{standalone}
\usepackage{tikz,pgf}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture} [every node/.style={draw,circle}]
\node (b) at (0,5){b};
\node (c) at (8,5){c};
\node (f) at (0,2){f};
\node (h) at (1,0){h};
\node (i) at (7,0){i};
\node (l) at (6,5){l};
\draw (f) edge [name path=pf, line width=2pt, in=-90, out=0] (l);
\draw (b) edge [ name path=pb, line width=2pt, in=180, out=-90] (i);
\draw (h) edge [name path=ph, line width=2pt, in=-90, out=0] (c);
\node [name intersections={of=pb and ph, by={e}}, fill=white] at (e) {e};
\node [name intersections={of=pb and pf, by={d}}, fill=white] at (d) {d};
\end{tikzpicture}
\end{document}
答案1
我发现了一个肮脏的解决方案,在节点之间绘制一个椭圆d
然后e
重新绘制它们。
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections,shapes,fit,calc}
\begin{document}
\begin{tikzpicture} [every node/.style={draw,circle}]
\node (b) at (0,5){b};
\node (c) at (8,5){c};
\node (f) at (0,2){f};
\node (h) at (1,0){h};
\node (i) at (7,0){i};
\node (l) at (6,5){l};
\draw (f) edge [name path=pf, line width=2pt, in=-90, out=0] (l);
\draw (b) edge [name path=pb, line width=2pt, in=180, out=-90] (i);
\draw (h) edge [name path=ph, line width=2pt, in=-90, out=0] (c);
\node [name path=circe,name intersections={of=pb and ph, by={e}},fill=white] at (e) {e};
\node [name path=circd,name intersections={of=pb and pf, by={d}},fill=white] at (d) {d};
\path [name intersections={of=circd and pb, by={d1,d2}}];
\path [name intersections={of=circe and pb, by={ee}}];
\path let
\p1 = ($(d2.north east)-(ee.south west)$),
\n1 = {veclen(\p1)}
in
(d2.south) -- (ee.north)
node[white,midway, sloped, draw, ellipse,fill=white,
minimum width=\n1, minimum height=\n1/4] {};
\node [name path=circe,name intersections={of=pb and ph, by={e}}] at (e) {e};
\node [name path=circd,name intersections={of=pb and pf, by={d}}] at (d) {d};
\end{tikzpicture}
\end{document}