정방형 피라미드를 만드는 방법?

정방형 피라미드를 만드는 방법?

팔면체에 대해 다음 코드가 있습니다. 아래 부분을 제거하고 각 정점에 대해 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}

여기에 이미지 설명을 입력하세요

관련 정보