在 Awodey 的第二版中范畴论他建议将圆锥体想象成一个多面金字塔。我很想制作正确的交换图,但我不知道如何制作多面金字塔。第一个图只是一个多面金字塔,而第二个图是两个这样的金字塔(共用同一个底座)的叠加,只是顶点不同,中间有一个箭头。
编辑:这差不多是我想要制作的第一张图表,不过我希望我的金字塔是对称的。最好是黑白的,指向顶点的垂直箭头保持为红色,金字塔表面略带蓝色(但仍然透明)。
第二张图会有另一个金字塔,其顶点平移到相同的高度,叠加在第一张图的金字塔上。
答案1
也许这就是你想要的?我使用了regular polygon
金字塔的形状,底座有 8 个面;底座倾斜且旋转。根据您的需要调整设置:
代码:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{
mypyr/.style={
regular polygon,
regular polygon sides=8,
minimum size=3cm,
rotate=-50,
yslant=0.5
}
}
\begin{document}
\begin{tikzpicture}
\node[mypyr]
(base1) at (0,0) {};
\coordinate (appex1) at (0,4);
\foreach \Coord in {1,4,5,6,7,8}
{
\draw (base1.corner \Coord) -- (appex1);
}
\foreach \Coord in {2,3}
{
\draw[dashed] (base1.corner \Coord) -- (appex1);
}
\foreach \Coord in {4,...,7}
{
\fill[blue,opacity=0.2]
(base1.corner \Coord) -- (base1.corner \the\numexpr\Coord+1\relax) -- (appex1) -- cycle;
}
\fill[blue,opacity=0.2]
(base1.corner 8) -- (base1.corner 1) -- (appex1) -- cycle;
\node[mypyr,draw] at (0,0) {};
\foreach \Coord in {1,...,4}
{
\draw[opacity=0.6]
(base1.corner \Coord) -- (base1.corner \the\numexpr\Coord+4\relax);
}
\fill[orange!40,opacity=0.4]
(base1.corner 2) --
(appex1) --
(base1.corner 6) -- cycle;
\draw[red] (0,0) -- (appex1);
\end{tikzpicture}
\begin{tikzpicture}
\node[mypyr]
(base1) at (0,0) {};
\coordinate (appex1) at (0,4);
\coordinate (appex2) at (-2.5,4);
\foreach \Coord in {1,4,5,6,7,8}
{
\draw (base1.corner \Coord) -- (appex1);
\draw (base1.corner \Coord) -- (appex2);
}
\foreach \Coord in {2,3}
{
\draw[dashed] (base1.corner \Coord) -- (appex1);
\draw[dashed] (base1.corner \Coord) -- (appex2);
}
\foreach \Coord in {4,...,7}
{
\fill[blue,opacity=0.2]
(base1.corner \Coord) -- (base1.corner \the\numexpr\Coord+1\relax) -- (appex1) -- cycle;
\fill[green,opacity=0.2]
(base1.corner \Coord) -- (base1.corner \the\numexpr\Coord+1\relax) -- (appex2) -- cycle;
}
\fill[blue,opacity=0.2]
(base1.corner 8) -- (base1.corner 1) -- (appex1) -- cycle;
\fill[green,opacity=0.2]
(base1.corner 8) -- (base1.corner 1) -- (appex2) -- cycle;
\draw[red] (0,0) -- (appex1);
\draw[red] (0,0) -- (appex2);
\draw[red] (appex1) -- (appex2);
\node[mypyr,draw] at (0,0) {};
\foreach \Coord in {1,...,4}
{
\draw[opacity=0.6]
(base1.corner \Coord) -- (base1.corner \the\numexpr\Coord+4\relax);
}
\end{tikzpicture}
\end{document}