1

I want to draw a triangular prism that should from the formatting point of view look like the following oktaeder

enter image description here

My starting point is this

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
 \draw[dashed,thick] (-1,0) -- (0,0.5) edge (0,2.5) -- (1,0) coordinate(BR);
 \draw[thick] (-1,0) coordinate(BL)  rectangle (1,2) coordinate(TR) 
 -- (0,2.5) coordinate(T) -- (-1,2) coordinate(TL);
 \foreach \X [remember=\X as \Y (initially TL),count=\Z] in {BL,BR,TR,T,TL}
 {\path (\Y) -- (\X) node[midway,anchor={90*\Z-90-ifthenelse(\Z==4,45,0)-ifthenelse(\Z==5,45,0)}]{label \Z}; }
\end{tikzpicture}
\end{document}

enter image description here

3

How about this?

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,bending,calc}
\begin{document}
\begin{tikzpicture}[lbl/.style={circle,draw,inner sep=1pt},>={Latex[bend]}]
 \draw[dashed,thick]  (0,2.5) coordinate(T) (-1,0) coordinate(BL) -- (0,0.5) coordinate(B)
  edge (T) -- (1,0) coordinate(BR);
 \draw[<-] ($(T)!0.5!(BL)$) to[out=90,in=-45] ++ (-0.5,1) node[lbl,above left]{5};
 \draw[<-] ($(T)!0.5!(BR)$) to[out=90,in=-135] ++ (0.5,1) node[lbl,above right]{4};
 \draw[<-] (0.1,0.3) to[bend left=20] ++ (0,-0.5) node[lbl,below]{2};
 \draw[thick,fill=white,fill opacity=0.7] (BL)   rectangle (1,2) coordinate(TR) 
 -- (0,2.5)  -- (-1,2) coordinate(TL);
 \path (-0.2,1)  node[lbl]{1};
 \draw[<-] ($(T)+(-0.1,-0.3)$) to[bend left=20] ++ (0,0.5) node[lbl,above]{3};
\end{tikzpicture}
\end{document}

enter image description here

1
  • You are the best! – wayne Feb 24 '20 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.