如何製作四角錐體?

如何製作四角錐體?

我有以下八面體程式碼。我需要刪除下面的部分,並為每個頂點寫入 A、B、C、D、E。我不知道如何做。我們將不勝感激您的幫助。

\[
\begin{tikzpicture}[z={(-.3cm,-.2cm)}, % direction z gets projected to; can also change x,y
                                       % use cm to specify non-transformed coordinates
                    line join=round, line cap=round, % makes the corners look nicer
                    every node/.style = {inner sep=1pt, font=\scriptsize}
                   ]
  \draw ( 0,2,0) node[above] {} --
        (-2,0,0) node [left] {} --
        (0,-2,0) node[below] {} --
        ( 2,0,0) node[right] {} --
        ( 0,2,0) --
        ( 0,0,2) node[below left] {} --
        (0,-2,0) (2,0,0) -- (0,0,2) -- (-2,0,0);
  \draw[dashed] (0,2,0) -- (0,0,-2) -- (0,-2,0) (2,0,0) -- (0,0,-2) -- (-2,0,0);
\end{tikzpicture}
\]

事實上,我們有一個四面體,它的底面是三角形,但我需要底面是一個矩形,一個四角錐體,每個頂點都有字母。

答案1

像這樣的東西嗎?

\documentclass[border=10pt]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[
    z={(-.3cm,-.2cm)},
    line join=round, 
    line cap=round,  
    every node/.style={
        inner sep=1pt, 
        font=\scriptsize
    }
]

    \draw
        (0,2,0) node[above] {A} --
        (-2,0,0) node[left] {B} --
        (0,0,2) node[below] {C} --
        (2,0,0) node[right] {D} -- cycle
        (0,0,2) -- (0,2,0);
    \draw[dashed] 
        (0,2,0) -- (0,0,-2) node[below] {E} 
        (2,0,0) -- (0,0,-2) -- (-2,0,0);
        
\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容