如何使用Tikz重建经典的观点插图
我正在尝试使用Tikz复制这种原理图。我当前的代码是
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\node[anchor = south west, inner sep = 0, minimum width = 1170 pt, minimum height = 500 pt] (image) at (0, 0) {};
\begin{scope}[x = {(image.south east)}, y = {(image.north west)}]
% \clip (0, 0) rectangle(1, 1);
\coordinate (C) at (0.33, 1.05);
\coordinate (R) at (1.6, 1.05);
\coordinate (L) at (0.33 - 1.27, 1.05);
\coordinate (P1) at (8 * 0.09, 0.07);
\coordinate (P2) at (0.03 + 8 * 0.09, 0.07);
\coordinate (P3) at (8 * 0.09, 0.9) node [above] {p3};
\coordinate (P4) at (0.03 + 8 * 0.09, 0.9) node {p4};
\draw [dashed, blue, name path = P3C] (P3) -- (C);
\draw [dashed, blue] (P4) -- (C);
\draw (L) -- (R);
\foreach \x in {0, 0.09, ..., 1} {
\draw [dashed, blue] (\x, 0.07) -- (C);
\draw [dashed, violet] (\x, 0.07) -- (R);
\draw [dashed, red] (\x, 0.07) -- (L);
}
\draw [name path = L1] (0, 0.2871) -- (1, 0.2871);
\draw [name path = L2] (0, 0.19) -- (1, 0.19);
\path [name path = P1C] (P1) -- (C);
\coordinate [name intersections = {of = P1C and L1, by = P1a}];
\draw [orange, thick] (P1) -- (P1a);
\path [name path = P1aV] (C) -| (P1a);
\coordinate [name intersections = {of = P1aV and P3C, by = P13}];
\draw [orange, thick] (P13) circle (3 pt);
\filldraw [gray] (0, 0) rectangle (11 * 0.09, 0.07);
\filldraw [gray] (P1) rectangle (0.03 + 8 * 0.09, 0.9);
\draw [red, fill] (P1) circle (2 pt);
\draw [violet, fill] (P1a) circle (2 pt);
\draw [green, fill] (P2) circle (2 pt);
\draw [blue, fill] (P3) circle (2 pt);
\draw [orange, fill] (P4) circle (2 pt);
\end{scope}
\end{tikzpicture}
\end{document}
在交叉点的详细信息中陷入困境,我正在寻找简化代码的方法,并有助于构造八角形平板及其投影。
I am trying to reproduce this schematic construction using TiKz. My current code is
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\node[anchor = south west, inner sep = 0, minimum width = 1170 pt, minimum height = 500 pt] (image) at (0, 0) {};
\begin{scope}[x = {(image.south east)}, y = {(image.north west)}]
% \clip (0, 0) rectangle(1, 1);
\coordinate (C) at (0.33, 1.05);
\coordinate (R) at (1.6, 1.05);
\coordinate (L) at (0.33 - 1.27, 1.05);
\coordinate (P1) at (8 * 0.09, 0.07);
\coordinate (P2) at (0.03 + 8 * 0.09, 0.07);
\coordinate (P3) at (8 * 0.09, 0.9) node [above] {p3};
\coordinate (P4) at (0.03 + 8 * 0.09, 0.9) node {p4};
\draw [dashed, blue, name path = P3C] (P3) -- (C);
\draw [dashed, blue] (P4) -- (C);
\draw (L) -- (R);
\foreach \x in {0, 0.09, ..., 1} {
\draw [dashed, blue] (\x, 0.07) -- (C);
\draw [dashed, violet] (\x, 0.07) -- (R);
\draw [dashed, red] (\x, 0.07) -- (L);
}
\draw [name path = L1] (0, 0.2871) -- (1, 0.2871);
\draw [name path = L2] (0, 0.19) -- (1, 0.19);
\path [name path = P1C] (P1) -- (C);
\coordinate [name intersections = {of = P1C and L1, by = P1a}];
\draw [orange, thick] (P1) -- (P1a);
\path [name path = P1aV] (C) -| (P1a);
\coordinate [name intersections = {of = P1aV and P3C, by = P13}];
\draw [orange, thick] (P13) circle (3 pt);
\filldraw [gray] (0, 0) rectangle (11 * 0.09, 0.07);
\filldraw [gray] (P1) rectangle (0.03 + 8 * 0.09, 0.9);
\draw [red, fill] (P1) circle (2 pt);
\draw [violet, fill] (P1a) circle (2 pt);
\draw [green, fill] (P2) circle (2 pt);
\draw [blue, fill] (P3) circle (2 pt);
\draw [orange, fill] (P4) circle (2 pt);
\end{scope}
\end{tikzpicture}
\end{document}
I am bogged down in the details of intersections, and I am looking for ways to streamline the code, as well as help with the construction of the octagonal slab and its projection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是代码:
ps:如果有人可以弄清楚如何移动眼睛的图像,以使虹膜处于警察处,我会感激不已。
Here is the code:
PS: If someone can figure out how to move the image of the eye so that the iris is at the CoP, I would be grateful.