Creating a labeled tetrahedron with tikzpicture

With help from Wikipedia and TikZ

\documentclass[tikz,border=3mm]{standalone}
\begin{document}

\begin{tikzpicture}[line join = round, line cap = round]
\pgfmathsetmacro{\factor}{1/sqrt(2)};
\coordinate [label=right:A] (A) at (2,0,-2*\factor);
\coordinate [label=left:B] (B) at (-2,0,-2*\factor);
\coordinate [label=above:C] (C) at (0,2,2*\factor);
\coordinate [label=below:D] (D) at (0,-2,2*\factor);

\draw[->] (0,0) -- (3,0,0) node[right] {$x$};
\draw[->] (0,0) -- (0,3,0) node[above] {$y$};
\draw[->] (0,0) -- (0,0,3) node[below left] {$z$};
\foreach \i in {A,B,C,D}
    \draw[dashed] (0,0)--(\i);
\draw[-, fill=red!30, opacity=.5] (A)--(D)--(B)--cycle;
\draw[-, fill=green!30, opacity=.5] (A) --(D)--(C)--cycle;
\draw[-, fill=purple!30, opacity=.5] (B)--(D)--(C)--cycle;
\end{tikzpicture}

\end{document}

Tetahedron


this is a hexahedral, but maybe this gives you a starting point.

\begin{tikzpicture}[x=0.65cm, y=0.65cm]

% Specify the coordinates
\coordinate (P0) at (0.0, 0.0); % 0
\coordinate (P1) at (10.0, 0.0); % 1
\coordinate (P2) at (13.0, 2.50); % 2
\coordinate (P3) at (3.0, 2.50); % 3

\coordinate (P4) at (0.0, 6.0); % 4
\coordinate (P5) at (10.0, 6.0); % 5
\coordinate (P6) at (14.0, 8.50); % 6
\coordinate (P7) at (3.0, 8.50); % 7


% draw and number the edges
\draw[line width=0.5pt] (P0) -- (P1);
\node[fill=white] (c) at ($(P0)!0.5!(P1)$) {$0 \,\rightarrow$};

\draw[line width=0.5pt] (P1) -- (P2);
\node[fill=white] (c) at ($(P1)!0.55!(P2)$) {$\overset{\nearrow}{5}$};

\draw[line width=0.5pt] (P0) -- (P4);
\node[fill=white] (c) at ($(P0)!0.5!(P4)$) {$\overset{\uparrow}{8}$};

\draw[line width=0.5pt] (P4) -- (P5);
\node[fill=white] (c) at ($(P4)!0.5!(P5)$) {$3 \,\rightarrow$};

\draw[line width=0.5pt] (P4) -- (P7);
\node[fill=white] (c) at ($(P4)!0.5!(P7)$) {$\overset{\nearrow}{7}$};

\draw[line width=0.5pt] (P5) -- (P6);
\node[fill=white] (c) at ($(P5)!0.5!(P6)$)   {$\overset{\text{\rotatebox[origin=c]{-8}{$\nearrow$}}}{6}$};

\draw[line width=0.5pt] (P7) -- (P6);
\node[fill=white] (c) at ($(P7)!0.5!(P6)$) {$2 \,\rightarrow$};

\draw[line width=0.5pt] (P1) -- (P5);
\node[fill=white] (c) at ($(P1)!0.6!(P5)$) {$\overset{\uparrow}{9}$};

\draw[line width=0.5pt] (P2) to[out=90,in=-120] (P6);
\node[fill=white,anchor=east] (c) at ($(P2)!0.5!(P6)$)     {$\overset{\text{\rotatebox[origin=c]{-10}{$\uparrow$}}}{10}$};

\draw[dashed, line width=0.5pt] (P3) -- (P0);
\node[fill=white] (c) at ($(P0)!0.65!(P3)$) {$\overset{\nearrow}{4}$};

\draw[dashed, line width=0.5pt] (P3) -- (P2);
\node[fill=white] (c) at ($(P3)!0.5!(P2)$) {$1 \,\rightarrow$};

\draw[dashed, line width=0.5pt] (P3) -- (P7);
\node[fill=white] (c) at ($(P3)!0.35!(P7)$) {$\overset{\uparrow}{11}$};

% numbering the nodes
\foreach \i in {2,3,6,7}
{
    \draw[fill=black] (P\i) circle (0.15em)
    node[above right,blue,font=\bfseries] {\Large \i};
}
\foreach \i in {0,1,4,5}
{
    \draw[fill=black] (P\i) circle (0.15em)
    node[below left,blue,font=\bfseries] {\Large \i};
}

% coordinate system
\node (x) at ($(P0)!0.15!(P1)$) {};
\node (y) at ($(P0)!0.45!(P3)$) {};
\node (z) at ($(P0)!0.35!(P4)$) {};

\draw[-latex,thick] (P0) to (x) node [below] {$x$};
\draw[-latex,thick] (P0) to (y) node [below] {$y$};
\draw[-latex,thick] (P0) to (z) node [right] {$z$};

\end{tikzpicture}

A block

The points are labelled, so this will be rather easy to modify. Have fun. I created this image from some example from TeXample.net.

The following code creates the block as a standalone image. Works with pdflatex.

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{amsmath}

\begin{document}

\input{block.tikz}

\end{document}

Run with xelatex

\documentclass{article}
\usepackage{pst-solides3d}

\begin{document}
\psset{viewpoint=40 10 10 rtp2xyz,lightsrc=viewpoint,Decran=30}
\begin{pspicture}[solidmemory](-2,-2)(3,3)
\psSolid[object=tetrahedron,r=3,action=draw*,name=T,num=1 2 3]% without 0
\psSolid[object=point,definition=solidgetsommet,args=T 0,text=Top,pos=uc]% Point T0 (top)
\end{pspicture}
\end{document}

enter image description here

Tags:

3D

Tikz Pgf