TikZ folding: Three more Archimedean solids

As I explained in a previous post, my interest in the TikZ folding library was recently rekindled, three years after I first added the remaining Platonic solids to that library. I’ve been busy added the remaining Archimedean solids. In that previous post I explained the preparatory work I had done for the remaining Archimedean solids. In this post I will give the code for the truncated cube, the truncated octahedron and the rhombicuboctahedron.

The reason why I’m already posting about these three, and not waiting until the rest is finished, is the following. The next solid in line is the truncated cuboctahedron. In this solid some extra problems arose: the ears overlap with the faces. To solve this gracefully I’ve made some adjustments to the ear-macro. Instead of just changing the size of the ear, I’ve made it a bit more customisable. I want to spend an entire blog post on that subject, so at the moment I’m just getting these three solids out of the way.

The implementation of these three solids is more or less along the lines of the implementation of the previous solids, so I don’t think I need to explain in much detail. However, feel free to ask a question if something isn’t clear.

The truncated cube is a solid with 14 faces: 8 triangles and 6 octagons. We will be constructing the following net:

Net for the truncated cube

A truncated cube as it is drawn by the folding library.

And this the implementation of the truncated cube:

\def\tikzfoldingtruncatedcube#1[#2]#3;{%
  \begingroup%
    \tikzset{#2}%
    \tikz@lib@fold@octagon
        {\tikz@lib@fold@face@A}
        {\tikz@lib@fold@octagon
             {\tikz@lib@fold@face@B}
	         {\tikz@lib@fold@ear@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@C}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@D}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
	         {\tikz@lib@fold@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@E}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@F}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
        }
        {\tikz@lib@fold@cut@path}
        {\tikz@lib@fold@octagon
             {\tikz@lib@fold@face@G}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@ear@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@H}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
	         {\tikz@lib@fold@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@ear@path}
	         {\tikz@lib@fold@cut@path}
        }
        {\tikz@lib@fold@cut@path}
        {\tikz@lib@fold@octagon
             {\tikz@lib@fold@face@I}
	         {\tikz@lib@fold@octagon
                     {\tikz@lib@fold@face@J}
	             {\tikz@lib@fold@cut@path}
	             {\tikz@lib@fold@cut@path}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@triangle
                         {\tikz@lib@fold@face@K}
	                 {\tikz@lib@fold@ear@path}
	                 {\tikz@lib@fold@path}
	                 {\tikz@lib@fold@ear@path}
                     }
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@triangle
                         {\tikz@lib@fold@face@L}
	                 {\tikz@lib@fold@ear@path}
	                 {\tikz@lib@fold@path}
	                 {\tikz@lib@fold@ear@path}
                     }
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@cut@path}
                 }
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
        }
        {\tikz@lib@fold@cut@path}
        {\tikz@lib@fold@octagon
             {\tikz@lib@fold@face@M}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@ear@path}
	         {\tikz@lib@fold@cut@path}
	         {\tikz@lib@fold@path}
	         {\tikz@lib@fold@triangle
                     {\tikz@lib@fold@face@N}
	             {\tikz@lib@fold@ear@path}
	             {\tikz@lib@fold@path}
	             {\tikz@lib@fold@ear@path}
                 }
	         {\tikz@lib@fold@ear@path}
	         {\tikz@lib@fold@cut@path}
        }
        {\tikz@lib@fold@cut@path}
  \endgroup
}

Next up is the truncated octahedron. This Archimedean solid also has 14 faces, but this time it are 6 squares and 8 hexagons.

The net of a truncated octahedron

A truncated octahedron as it is drawn by the folding library.

Below is the code for the truncated octahedron.

\def\tikzfoldingtruncatedoctahedron#1[#2]#3;{%
  \begingroup%
    \tikzset{#2}%
    \tikz@lib@fold@hexagon
        {\tikz@lib@fold@face@A}
        {\tikz@lib@fold@hexagon
            {\tikz@lib@fold@face@B}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@C}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
            {\tikz@lib@fold@hexagon
                {\tikz@lib@fold@face@D}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
            }
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@E}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@F}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@ear@path}
            }
            {\tikz@lib@fold@hexagon
                {\tikz@lib@fold@face@G}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@ear@path}
            }
        }
        {\tikz@lib@fold@cut@path}
        {\tikz@lib@fold@ear@path}
        {\tikz@lib@fold@square
            {\tikz@lib@fold@face@H}
            {\tikz@lib@fold@hexagon
                {\tikz@lib@fold@face@I}
                {\tikz@lib@fold@hexagon
                    {\tikz@lib@fold@face@J}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@cut@path}
                }
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@K}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@cut@path}
                }
                {\tikz@lib@fold@hexagon
                    {\tikz@lib@fold@face@L}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                }
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@hexagon
                    {\tikz@lib@fold@face@M}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                }
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@N}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@ear@path}
                }
            }
            {\tikz@lib@fold@ear@path}
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@ear@path}
        }
        {\tikz@lib@fold@ear@path}
        {\tikz@lib@fold@cut@path}
  \endgroup
}

And finally the rhombicuboctahedron. This solid consists of 8 triangles and 18 squares, giving a total of 26 faces.

A net of a rhombicuboctahedron

A rhombicuboctahedron as it is drawn by the folding library.

And as expected the code for the rhombicuboctahedron.

\def\tikzfoldingrhombicuboctahedron#1[#2]#3;{%
  \begingroup%
    \tikzset{#2}%
    \tikz@lib@fold@square
        {\tikz@lib@fold@face@A}
        {\tikz@lib@fold@square
            {\tikz@lib@fold@face@B}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@C}
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@D}
                    {\tikz@lib@fold@square
                        {\tikz@lib@fold@face@E}
                        {\tikz@lib@fold@cut@path}
                        {\tikz@lib@fold@square
                            {\tikz@lib@fold@face@F}
                            {\tikz@lib@fold@ear@path}
                            {\tikz@lib@fold@ear@path}
                            {\tikz@lib@fold@path}
                            {\tikz@lib@fold@cut@path}
                        }
                        {\tikz@lib@fold@path}
                        {\tikz@lib@fold@square
                            {\tikz@lib@fold@face@G}
                            {\tikz@lib@fold@ear@path}
                            {\tikz@lib@fold@cut@path}
                            {\tikz@lib@fold@path}
                            {\tikz@lib@fold@ear@path}
                        }
                    }
                    {\tikz@lib@fold@triangle
                        {\tikz@lib@fold@face@H}
                        {\tikz@lib@fold@ear@path}
                        {\tikz@lib@fold@path}
                        {\tikz@lib@fold@cut@path}
                    }
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@triangle
                        {\tikz@lib@fold@face@I}
                        {\tikz@lib@fold@cut@path}
                        {\tikz@lib@fold@path}
                        {\tikz@lib@fold@ear@path}
                    }
                }
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@J}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@cut@path}
                }
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@K}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@ear@path}
                }
            }
            {\tikz@lib@fold@triangle
                {\tikz@lib@fold@face@L}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@triangle
                {\tikz@lib@fold@face@M}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@ear@path}
            }
        }
        {\tikz@lib@fold@square
            {\tikz@lib@fold@face@N}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@O}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
            {\tikz@lib@fold@ear@path}
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@cut@path}
        }
        {\tikz@lib@fold@square
            {\tikz@lib@fold@face@P}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@Q}
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@R}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@triangle
                        {\tikz@lib@fold@face@S}
                        {\tikz@lib@fold@cut@path}
                        {\tikz@lib@fold@path}
                        {\tikz@lib@fold@ear@path}
                    }
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@triangle
                        {\tikz@lib@fold@face@T}
                        {\tikz@lib@fold@ear@path}
                        {\tikz@lib@fold@path}
                        {\tikz@lib@fold@cut@path}
                    }
                }
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@U}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@cut@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@ear@path}
                }
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@square
                    {\tikz@lib@fold@face@V}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@ear@path}
                    {\tikz@lib@fold@path}
                    {\tikz@lib@fold@cut@path}
                }
            }
            {\tikz@lib@fold@triangle
                {\tikz@lib@fold@face@W}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@ear@path}
            }
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@triangle
                {\tikz@lib@fold@face@X}
                {\tikz@lib@fold@ear@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
        }
        {\tikz@lib@fold@square
            {\tikz@lib@fold@face@Y}
            {\tikz@lib@fold@square
                {\tikz@lib@fold@face@Z}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@cut@path}
                {\tikz@lib@fold@path}
                {\tikz@lib@fold@cut@path}
            }
            {\tikz@lib@fold@cut@path}
            {\tikz@lib@fold@path}
            {\tikz@lib@fold@ear@path}
        }
  \endgroup
}
Advertisements
Comments
One Response to “TikZ folding: Three more Archimedean solids”
Trackbacks
Check out what others are saying...


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: