请问一下各位大佬,能给一个画正四面体的例子么?我找了一个画立方体的,可是按照着修改,很多错误。

2020-03-28 12:36发布

% !Mode:: TeX:UTF-8%確保文檔utf-8編碼\documentclass[tikz,border=2pt]{standalone} \begin{document}\begin{ti...

% !Mode:: “TeX:UTF-8”%確保文檔utf-8編碼
\documentclass[tikz,border=2pt]{standalone}

\begin{document}
\begin{tikzpicture}
%draw the axes
\draw[->] (0,0,0) — (3,0,0) node[anchor=west]{$x$};
\draw[->] (0,0,0) — (0,3,0) node[anchor=west]{$y$};
\draw[->] (0,0,0) — (0,0,3) node[anchor=west]{$z$};
%draw the top and bottom of the cube
\draw (0,0,0) — (0,2,0) — (2,2,0) — (2,0,0) — cycle;
\draw[] (0,0,2) — (0,2,2) — (2,2,2) — (2,0,2) — cycle;
%draw the edges of the cube
\draw[] (0,0,0) — (0,0,2);
\draw[] (0,2,0) — (0,2,2);
\draw[] (2,0,0) — (2,0,2);
\draw (2,2,0) — (2,2,2);
\end{tikzpicture}
\end{tikzpicture}

\end{document}

4条回答
poorich
2020-04-04 16:33
\begin{tikzpicture}[z={(-.3cm,-.2cm)}, line join=round, scale=0.6] \draw[color={gray!30}] (1,1,1) -- (-1,1,1) -- (-1,-1,1) -- (1,-1,1) -- (1,1,1) -- (1,1,-1) -- (-1,1,-1) -- (-1,1,1) (1,1,-1) -- (1,-1,-1) -- (1,-1,1); \draw[dashed,color={gray!30}] (-1,1,-1) -- (-1,-1,-1) -- (-1,-1,1) (-1,-1,-1) -- (1,-1,-1); %%%%%%%%%%%% \draw[gray!60,thick] (-1,-1,-1) -- (1,1,-1); \draw[thick] (-1,1,1) -- (1,-1,1) -- (1,1,-1) -- (-1,1,1) -- (-1,-1,-1) -- (1,-1,1); \end{tikzpicture}

一周热门 更多>