| 1 |
\section{Some basic types and their string representations} |
| 2 |
\label{sec:types} |
| 3 |
A {\tt point} type is the structure |
| 4 |
\begin{verbatim} |
| 5 |
struct { |
| 6 |
int x, y; |
| 7 |
} |
| 8 |
\end{verbatim} |
| 9 |
The fields can either give an absolute position or represent a |
| 10 |
vector displacement. |
| 11 |
A {\tt pointf} type is the same, with {\tt int} replaced with {\tt double}. |
| 12 |
A {\tt box} type is the structure |
| 13 |
\begin{verbatim} |
| 14 |
struct { |
| 15 |
point LL, UR; |
| 16 |
} |
| 17 |
\end{verbatim} |
| 18 |
representing a rectangle. The {\tt LL} gives the coordinates of the |
| 19 |
lower-left corner, while the {\tt UR} is the upper-right corner. |
| 20 |
A {\tt boxf} type is the same, with {\tt point} replaced with {\tt pointf}. |
| 21 |
|
| 22 |
The following gives the accepted string representations |
| 23 |
corresponding to values of the given types. |
| 24 |
Whitespace is ignored when converting these values from strings |
| 25 |
to their internal representations. |
| 26 |
|
| 27 |
\begin{description} |
| 28 |
\item[{\tt point}] {\tt "x,y"} where {\tt (x,y)} are the integer coordinates |
| 29 |
of a position in points (72 points = 1 inch). |
| 30 |
\item[{\tt pointf}] {\tt "x,y"} where {\tt (x,y)} are the |
| 31 |
floating-point coordinates of a position in inches. |
| 32 |
\item[{\tt rectangle}] {\tt "llx,lly,urx,ury"} |
| 33 |
where {\tt (llx,lly)} is the lower left corner |
| 34 |
of the rectangle and {\tt (urx,ury)} is the upper right corner, |
| 35 |
all in integer points. |
| 36 |
\item[{\tt splineType}] A semicolon-separated list of {\tt spline} values. |
| 37 |
\item[{\tt spline}] This type has an optional end point, an optional start |
| 38 |
point, and a space-separated list of $N = 3n+1$ points for some positive |
| 39 |
integer $n$. An end point consists of a {\tt point} preceded by {\tt "e,"}; |
| 40 |
a start point consists of a {\tt point} preceded by {\tt "s,"}. The |
| 41 |
optional components are separated by spaces. |
| 42 |
|
| 43 |
The terminating list of points $p_1,p_2,\ldots ,p_N$ gives the control points |
| 44 |
of a B-spline. |
| 45 |
If a start point is given, this indicates the presence of an arrowhead. |
| 46 |
The start point touches one node of the corresponding edge |
| 47 |
and the direction of the arrowhead is given by the vector from $p_1$ |
| 48 |
to the start point. If the start point is absent, the point $p_1$ |
| 49 |
will touch the node. The analogous interpretation holds for an end point |
| 50 |
and $p_N$. |
| 51 |
\end{description} |