我的代码有什么问题?使用 foreach 循环而不是直接绘制命令会导致路径未知的错误。你有什么建议吗?
提前谢谢您!
! 包 tikz 错误:我不知道名为“links 1”的路径。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw [name path=links 1] (0,0) -- +(10:5cm);
\draw [name path=links 2] (0,0) -- +(20:5cm);
\draw [name path=links 3] (0,0) -- +(30:5cm);
\draw [name path=rechts 1] (5,0) -- +(150:5cm);
\draw [name path=rechts 2] (5,0) -- +(160:5cm);
\draw [name path=rechts 3] (5,0) -- +(170:5cm);
% why can't I use the foreach-loops instead?
% \foreach \angle/\num in {10/1,20/2,30/3}{%
% \draw [name path=links \num] (0,0) -- +(\angle:5cm);
% }
%
% \foreach \angle/\num in {150/1,160/2,170/3}{%
% \draw [name path=rechts \num] (5,0) -- +(\angle:5cm);
% }
\fill [name intersections={of=links 1 and rechts 1, name=a}]
(a-1) circle (2pt) node {};
\fill [name intersections={of=links 1 and rechts 2, name=b}]
(b-1) circle (2pt) node {};
\fill [name intersections={of=links 2 and rechts 2, name=c}]
(c-1) circle (2pt) node {};
\end{tikzpicture}
\end{document}