2

In the second edition of Awodey's Category Theory he suggests visualizing a cone as a many sided pyramid. I'd much like to make the proper commutative diagrams, but I don't know how to make a many sided pyramid. The first diagram is just a many sided pyramid, while the second is a superposition of two such pyramids (sharing the same base), only with different apexes along with an arrow between them.

Edits: This is more or less the first diagram I'd like to make, except I'd like my pyramid to be symmetric. Preferably, in black and white, with the vertical arrow to the vertex remaining red and the pyramid faces slightly bluish (but still transparent). Many sided pyramid

The second diagram would have another pyrmaid with translated apex at the same height, superimposed over the one in the first diagram.

Exterior
  • 293
  • 1
    And you want to draw it I suppose. What is a commutative diagram? – percusse Nov 05 '14 at 11:31
  • 2
    Welcome to TeX.SX! I disagree with Awodey, but anybody is entitled their opinion. In any case, you should point to some online resource showing a sample of what you mean. – egreg Nov 05 '14 at 11:37
  • 1
    A quote from Awodey's book: "(The reader should draw some pictures at this point!)" – Benjamin McKay Nov 05 '14 at 11:39
  • @percusse, It's just a mathematical term. Knowing what is means is not a necessary detail here :) – Exterior Nov 05 '14 at 12:02
  • @egreg, Thank you! Could you say why you disagree with Awodey? What visualization would you suggest? His seems intuitive to me. – Exterior Nov 05 '14 at 12:04
  • @BenjaminMcKay, I did draw it, just not on a computer :) – Exterior Nov 05 '14 at 12:04
  • @Exterior It's just a matter of how I think to diagrams; calling such a thing a cone is justified, drawing it like a cone doesn't really show what's happening. – egreg Nov 05 '14 at 12:36
  • @egreg Perhaps after I get help I will show you the diagrams and you'll tell me what you think :) – Exterior Nov 05 '14 at 12:48
  • BTW, the easiest way to draw a regular polygon (base) is to put the vertexes on a circle. – John Kormylo Nov 05 '14 at 13:39

1 Answers1

5

Perhaps this is what you have in mind? I used the regular polygon shape for a pyramid with a 8-sided base; the base was slanted and rotated. Adjust the settings according to your needs:

enter image description here

The code:

\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}
Gonzalo Medina
  • 505,128
  • This is almost exactly what I want! I ask for only three minor modifications:
    1. On the right figure, make the purple pyramid right just as the left purple pyramid.
    2. Connect all points at each base to each other using more transparent lines.
    3. On the right figure, connect the apexes of the purple and green pyramid with another straight red line.

    Thank you very very much!

    – Exterior Nov 05 '14 at 17:42
  • @Exterior You're welcome! Please see my updated answer. Is this more close to what you need? – Gonzalo Medina Nov 05 '14 at 18:43
  • Why is it a cone? – cfr Nov 06 '14 at 02:12
  • Not all cones have a circular basis; a pyramid is a typical instance of a cone. – Exterior Nov 07 '14 at 01:02
  • @GonzaloMedina I'd like to ask for an additional modification of your wonderful answer. On the left diagram (the sole pyramid), I would like a triangle with a vertex at the vertex of the pyramid, but which is not a face, i.e its other two vertices are not adjacent vertices in the basis of the pyramid. If it's possible, color it light orange. As always, thank you very much in advance! – Exterior Dec 14 '14 at 16:34
  • @Exterior Add something like \fill[orange!30,opacity=0.3] (base1.corner 2) -- (appex1) -- (base1.corner 6) -- cycle; just before the first \end{tikzpicture} in my example code. Change the 2 and 6 to the desired values for the vertices in the base. – Gonzalo Medina Dec 14 '14 at 16:39
  • 1
    @Exterior I've updated my answer adding the required element. – Gonzalo Medina Dec 14 '14 at 16:45
  • @GonzaloMedina I'm sorry for torturing you again, but could you please make the vertex of the green pyramid higher than the vertex of the purple one? (so that the red line connecting them would be diagonal.) I really appreciate your help. – Exterior Dec 17 '14 at 18:07
  • @Exterior Change \coordinate (appex2) at (-2.5,4); to \coordinate (appex2) at (-2.5,4.3); (instead of 4.3 use the desired value.) – Gonzalo Medina Dec 18 '14 at 00:35