\title{Polyhedra \LaTeX\ package - v. 0.3}
\author{Zafeirakis zafeirakopoulos}
\maketitle
\begin{abstract}
This package provides macros for creating polyhedral objects in 2D and 3D.
It requires tikz and tikz-3dplot.
The macros provided can be used for drawing vertices, edges, rays, polygons and
cones.
\end{abstract}
\section{Introduction}
All the drawing commands work with keyword arguments and are the same in
2d and 3D.
\section{Functionality}
\subsection{The \emph{polyhedron} environment}
The \emph{polyhedron} environment is essentially a wrapper for a tikzpicture
environment.
It accepts as extra arguments the dimension of the picture (either $2$ or $3$)
and if the dimension is $3$, then the arguments for the three angles defining
the rotated coordinate system are given.
For the 3D coordinate system, we use tikz-plot3d.
The following macros work within the \texttt{polyhedron} environment.
\subsubsection{Point.} To let A be a point (x,y) or (x,y,z)
\begin{lstlisting}
\point{(x,y,z)}{A}
\end{lstlisting}
After defining a point, we can use the handle (variable name) A, instead of
writing down the coordinates in the macros that follow.
\subsubsection{Axes.}
We saw already some examples using the \emph{axes} command.
All drawing commands accept the following options:
\begin{description}
\item[color] The color of the polyhedral object to draw.
\item[status] The status of the object. The possible values are:
\begin{itemize}
\item normal
\item focus
\item alert
\item open
\end{itemize}
\item[opacity] The opacity of the object.
\item[thickness] The width of the lines
\item[pattern] The draw pattern
\end{description}
\subsubsection{Vertex}
The \emph{vertex} command is used to draw a vertex at a point (x,y,z) or A.
The standard options of color, status, opacity, thickness and pattern apply.
The extra options for vertex are:
\begin{description}
\item[point] sets the coordinates of the vertex and it can be either a tikz
coordinate tuple or a point already defined.
\item[text] The text of the vertex label.
\item[textcolor] The color of the label's text.
\item[anchora] The label anchor relative to the vertex: north, south, east,
west
\item[anchorb] The text's anchor relative to the label: above, below, right,
left
\end{description}
\subsubsection{Edges and Rays} The command \emph{edge} is used to draw an
edge from point A to point B.
The extra arguments are:
\begin{description}
\item[points] sets the coordinates of the vertices of the edge. It is a list
of (two) points in \{\}.
\end{description}
Similarly, the command \emph{ray} draw a ray.
The options are exactly the same as for edge.
Note that the sequence in which the points are given matters.
\begin{center}
\begin{minipage}{0.7\textwidth}
\begin{lstlisting}
\begin{polyhedron}{}
\ray{points={(0,0),(2,2)},status=alert}
\ray{points={(0,0),(2,3)},status=focus}
\ray{points={(0,0),(2,4)},status=open}
\ray{points={(0,0),(2,5)},color=orange}
\ray{points={(0,0),(2,6)},status=normal}
\ray{points={(2,1),(3,3)},thickness=3}
\ray{points={(4,1),(3,3)},pattern={dotted}}
\end{polyhedron}
\end{lstlisting}
\end{minipage}
\hskip 2em
\begin{minipage}{0.2\textwidth}
\begin{polyhedron}{}
\ray{points={(0,0),(2,2)},status=alert}
\ray{points={(0,0),(2,3)},status=focus}
\ray{points={(0,0),(2,4)},status=open}
\ray{points={(0,0),(2,5)},color=orange}
\ray{points={(0,0),(2,6)},status=normal}
\ray{points={(2,1),(3,3)},thickness=3}
\ray{points={(4,1),(3,3)},pattern={dotted}}
\end{polyhedron}
\end{minipage}
\end{center}
\subsubsection{Cone}
The command \emph{cone} is used to draw a polyhedral cone.
The extra arguments are:
\begin{description}
\item[vertex] Sets the apex of the cone.
\item[generators] A list of points
\item[openeness] A list of boolean values declaring the openness of a
simplicial cone.
\end{description}
The command \emph{polygon} is used to draw a 2-dimensional polytope in 2D or 3D.
Attention must be paid in the sequence of the points given.
The command does not take the convex hull, but rather draws the polygonal
line defined by the sequence of points.
The extra arguments are:
\begin{description}
\item[points] The vertices of the cone.
\item[boundary] True or False, for drawing or not the boundary of the polygon.
\end{description}