Edit and compile if you like:
\documentclass{article} \usepackage{tikz} \usepackage{tikz-3dplot} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{0.125pt} % % File name: truncated-cube.tex % Description: % A geometric representation of truncated cube is shown. % % Date of creation: June, 19th, 2021. % Date of last modification: October, 9th, 2022. % Author: Efraín Soto Apolinar. % https://www.aprendematematicas.org.mx/author/efrain-soto-apolinar/instructing-courses/ % Source: page 84 of the % Glosario Ilustrado de Matem\'aticas Escolares. % https://tinyurl.com/5udm2ufy % % Terms of use: % According to TikZ.net % https://creativecommons.org/licenses/by-nc-sa/4.0/ % Your commitment to the terms of use is greatly appreciated. % \begin{document} \tdplotsetmaincoords{80}{115} % \begin{tikzpicture}[tdplot_main_coords] % Change the value of the number at {\escala}{##} to scale the figure up or down \pgfmathsetmacro{\escala}{1.25} \pgfmathsetmacro{\a}{\escala*(0.5+1.0/sqrt(2.0))} \pgfmathsetmacro{\b}{\escala*1.0/(2.0-2.0*sqrt(2.0))} % Coordinates of the vertices \coordinate(1) at (-0.5*\escala,\a,\a); \coordinate(2) at (-0.5*\escala,\a,\b); \coordinate(3) at (-0.5*\escala,\b,\a); \coordinate(4) at (-0.5*\escala,\b,\b); \coordinate(5) at (0.5*\escala,\a,\a); \coordinate(6) at (0.5*\escala,\a,\b); \coordinate(7) at (0.5*\escala,\b,\a); \coordinate(8) at (0.5*\escala,\b,\b); \coordinate(9) at (\a,-0.5*\escala,\a); \coordinate(10) at (\a,-0.5*\escala,\b); \coordinate(11) at (\a,0.5*\escala,\a); \coordinate(12) at (\a,0.5*\escala,\b); \coordinate(13) at (\a,\a,-0.5*\escala); \coordinate(14) at (\a,\a,0.5*\escala); \coordinate(15) at (\a,\b,-0.5*\escala); \coordinate(16) at (\a,\b,0.5*\escala); \coordinate(17) at (\b,-0.5*\escala,\a); \coordinate(18) at (\b,-0.5*\escala,\b); \coordinate(19) at (\b,0.5*\escala,\a); \coordinate(20) at (\b,0.5*\escala,\b); \coordinate(21) at (\b,\a,-0.5*\escala); \coordinate(22) at (\b,\a,0.5*\escala); \coordinate(23) at (\b,\b,-0.5*\escala); \coordinate(24) at (\b,\b,0.5*\escala); % faces with 3 vertices \draw[red,thick,fill=cyan!35,opacity=0.75] (3) -- (17) -- (24) -- (3); \draw[red,thick,fill=cyan!35,opacity=0.75] (22) -- (19) -- (1) -- (22); \draw[red,thick,fill=cyan!35,opacity=0.75] (23) -- (18) -- (4) -- (23); \draw[red,thick,fill=cyan!35,opacity=0.75] (2) -- (20) -- (21) -- (2); % faces with 8 vertices \draw[red,thick,fill=cyan!35,opacity=0.75] (3) -- (24) -- (23) -- (4) -- (8) -- (15) -- (16) -- (7) -- (3); \draw[red,thick,fill=cyan!35,opacity=0.75] (19) -- (22) -- (21) -- (20) -- (18) -- (23) -- (24) -- (17) -- (19); \draw[red,thick,fill=cyan!35,opacity=0.75] (6) -- (12) -- (10) -- (8) -- (4) -- (18) -- (20) -- (2) -- (6); \draw[red,thick,fill=cyan!35,opacity=0.75] (1) -- (19) -- (17) -- (3) -- (7) -- (9) -- (11) -- (5) -- (1); \draw[red,thick,fill=cyan!35,opacity=0.75] (5) -- (14) -- (13) -- (6) -- (2) -- (21) -- (22) -- (1) -- (5); \draw[red,thick,fill=cyan!35,opacity=0.75] (9) -- (16) -- (15) -- (10) -- (12) -- (13) -- (14) -- (11) -- (9); % faces with 3 vertices \draw[red,thick,fill=cyan!35,opacity=0.75] (8) -- (10) -- (15) -- (8); \draw[red,thick,fill=cyan!35,opacity=0.75] (13) -- (12) -- (6) -- (13); \draw[red,thick,fill=cyan!35,opacity=0.75] (16) -- (9) -- (7) -- (16); \draw[red,thick,fill=cyan!35,opacity=0.75] (5) -- (11) -- (14) -- (5); % \end{tikzpicture} \end{document}
Click to download: truncated-cube.tex • truncated-cube.pdf
Open in Overleaf: truncated-cube.tex
See more on the author page of Efraín Soto Apolinar.