excavated-cube

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: excavated-cube.tex
% Description: 
% A geometric representation of an excavated cube is shown.
% 
% Date of creation: September, 23rd, 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 86 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 number {\escala}{##} to scale the figure up or down.
	\pgfmathsetmacro{\escala}{3.25}
	\pgfmathsetmacro{\a}{\escala}
	\pgfmathsetmacro{\d}{\a * (3 / 8)}
	% Coordenadas de los vértices
	\coordinate(0) at (0,0,0);
	\coordinate(1) at (\a,0,0);
	\coordinate(2) at (\a,\a,0);
	\coordinate(3) at (0,\a,0);
	\coordinate(4) at (0,0,\a);
	\coordinate(5) at (\a,0,\a);
	\coordinate(6) at (\a,\a,\a);
	\coordinate(7) at (0,\a,\a);
	\coordinate(8) at (0.5*\a,0.5*\a,0.5*\a);
	\coordinate(9) at (0.5*\a,0.5*\a,\d); % z = 0
	\coordinate(10) at (0.5*\a,\d,0.5*\a); % y = 0
	\coordinate(11) at (\d,0.5*\a,0.5*\a); % x = 0
	\coordinate(12) at (0.5*\a,0.5*\a,\a-\d); % z = 1
	\coordinate(13) at (0.5*\a,\a-\d,0.5*\a); % y = 1
	\coordinate(14) at (\a-\d,0.5*\a,0.5*\a); % x = 1
	% faces of the polyhedron
	% faces at x = 0
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (0) -- (3) -- (11) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (3) -- (7) -- (11) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (7) -- (4) -- (11) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (4) -- (0) -- (11) -- cycle;
	
	% faces at y = 0
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (0) -- (1) -- (10) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (5) -- (4) -- (10) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (4) -- (0) -- (10) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (1) -- (5) -- (10) -- cycle;
	
	% faces at z = 0
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (3) -- (0) -- (9) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (0) -- (1) -- (9) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (1) -- (2) -- (9) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (2) -- (3) -- (9) -- cycle;
	
	% faces at z = 1
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (4) -- (5) -- (12) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (7) -- (4) -- (12) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (6) -- (7) -- (12) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (5) -- (6) -- (12) -- cycle;
	
	% faces at y = 1
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (2) -- (3) -- (13) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (3) -- (7) -- (13) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (7) -- (6) -- (13) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (6) -- (2) -- (13) -- cycle;
	
	% faces at x = 1
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (1) -- (2) -- (14) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (2) -- (6) -- (14) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (6) -- (5) -- (14) -- cycle;
	\draw[red,thick,fill=cyan!35,opacity=0.75]  (5) -- (1) -- (14) -- cycle;
	%
	\end{tikzpicture}
	%
\end{document}




Click to download: excavated-cube.texexcavated-cube.pdf
Open in Overleaf:
excavated-cube.tex
See more on the author page of Efraín Soto Apolinar.

Leave a Reply

Your email address will not be published.