Graphics, Figures & Tablescreating a labeled tetrahedron with tikzpicture

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Relative0
Posts: 1
Joined: Sat Apr 26, 2014 5:25 pm

creating a labeled tetrahedron with tikzpicture

Post by Relative0 »

I am wanting to draw a tetrahedron with labeled points on each corner. I attempted to edit the example of a cone that I found here: http://www.texample.net/tikz/examples/cone/
I have made it look partially like a tetrahedron but have not been able to get it right (let alone labeled points). Any help would be appreciated, my code is below. Thanks, Brian

Code: Select all

\begin{tikzpicture}[tdplot_main_coords]
\def\RI{2}
\def\RII{1.25}

\draw[] (\RI,0)
  \foreach \x in {0,240} { --  (\x:\RI) node at (\x:\RI) (R1-\x) {} };
\draw[dashed,thick] (R1-0.center)
  \foreach \x in {120} { --  (\x:\RI) node at (\x:\RI) (R1-\x) {} };


\begin{scope}[yshift=2cm]
\draw[thick,fill=gray!30,opacity=0.2] (\RII,0)
  \foreach \x in {0,120,240,360}
    { --  (\x:\RII) node at (\x:\RII) (R2-\x) {}};
\end{scope}

\foreach \x in {0,240} { \draw (R1-\x.center)--(R2-\x.center); };
\foreach \x in {120} { \draw[dashed] (R1-\x.center)--(R2-\x.center); };
\end{tikzpicture}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply