\def\pss{\vskip 4mm}
\def\nind{\noindent}
\def\bul{\item{$\bullet$}}

\centerline{\bf Geometric Description Language -- GDL}
\pss
by Javier Rodr\'{\i}guez-Laguna ({\tt javirl@fenix.imaff.csic.es})
\pss
Documentation on the 0.3 prescription for the geometric description
language (GDL), a computer language for the description of geometrical
constructions, aspiring to be the seeds of a free AutoCAD clone for
Linux (and much more!).
\pss
At compilation time, one may decide whether to have an X11 output
driver or a PostScript interface. Of course, this shall be improved in
later issues.

\pss\pss
{\bf Structure of a GDL program.}
\pss

The structure of a program is the following. Each line is to be
interpreted on its own. Most of the lines have the following
structure:
\pss

'Name' [description]
\pss
\nind which means that at that line a geometric object is declared to
have that description. The description may refer to other existent
objects. For example, if {\tt r} and {\tt s} are segments, then the
line
\pss

{\tt 'P' [int['r']['s']]}
\pss

\nind declares the point {\tt P} to be the intersection point of {\tt
r} and {\tt s}. Of course, that point might not exist without
provoking any error messages.
\pss

The other types of lines, in prescription 0.1 are just comments
(starting with a symbol {\tt \#}), or color statements, which have the
syntax:
\pss

{\tt color(red,green,blue)}
\pss
\nind where {\tt red}, {\tt green} and {\tt blue} are the components
of the given color in RGB space, with values in the range $[0,1]$.
\pss\pss

{\bf The geometric keywords.}
\pss
The 1.0 prescription keywords are: {\tt point}, {\tt segm}, {\tt
line}, {\tt circle}, {\tt ext}, {\tt extl}, {\tt med}, {\tt int}, {\tt
perp}, {\tt perpl}, {\tt compass} and {\tt center}. There are five
basic types of objects, on which these operators act. The types are:
\pss

\bul Point, given by two coordinates in its internal representation.

\bul Segment, given by four coordinates (for the two extreme
points). With a given flag on, it is a straight line (for which the
extreme points are not borders).

\bul Circle, given by center and radius.

\bul Multi, a ``set of objects''.

\bul Null, the ``null object''.
\pss

The operators act like this:
\pss

\bul Primitive:

{\tt point(x0,y0)} returns a point with those coordinates

{\tt segm(x0,y0,x1,y1)} and {\tt line(x0,y0,x1,y1)} return
respectively a segment and a line passing through those points.

{\tt circle(xc,yc,R)}, a circle.
\pss

\bul Derivated:

{\tt ext[p1][p2]}, if {\tt p1} and {\tt p2} are any point
specifications, returns the segment joining them.

{\tt extl[p1][p2]}, under the same conditions, returns the line
joining them.

{\tt med[s]}, if {\tt s} is a segment, returns its middle point. If it
is a circle, returns its center.

{\tt center[C]}, if {\tt C} is a circle, returns its center.

{\tt int[A][B]}, returns the intersection point (or points) of two
segments, a segment and a circle, or two circles. The result may be a
null, a point or a multi (a set of various objects, points in this
case).

{\tt compass[p1][p2]}, returns the circle which has {\tt p1} as its
center and passes through {\tt p2}.

{\tt perp[s][p]}, returns the perpendicular segment to {\tt s} passing
through {\tt s}. It may be null if {\tt p} belongs to {\tt s} or if
the projection point of {\tt p} on {\tt s} does not fall in the
segment.

{\tt perpl[s][p]} returns the perpendicular line, which never fails to exist.
Is calculated through the perpendicular vector. It is necessary, e.g., to find
mediatrices.
\pss\pss

\centerline{\bf ``Multi'' objects.}
\pss
``Bags'' of objects are rather special. They are obtained, e.g., when defining
a point as the intersection of two circles. Then, a {\tt multi} is created
which contains the two intersection points. The curious feature appears when
we try to draw the segment between these multi and another (single) point: not
one, but {\sl two} segments appear. This phenomenon shall be termed the {\sl
combinatorial explosion}.

The combinatorial explosion is not undesirable {\it per se\/}. Appears to be
``more'' symmetric than the other possible option (choose an arbitrary
element). Nevertheless, we are working on an alternative, which shall leave
this possibility open, but shall also permit the use of individual elements in
a multi. 

The idea (not yet implemented!) is to determine either a random single element
or an element specified by some property, such as the smallest distance to a
given point. Anyway, ideas on this point (and on the others, of course!) are 
welcome. 
\pss\pss


\centerline{\bf Configuration file.}

For now, the file {\tt gdl.rc} at the same directory as the executable
shall be the configuration file. Its lines may only start with the
four keywords: {\tt width} (the rest of the line shall be considered
to be the width of the screen, {\tt height} (correspondingly), {\tt
x11} (X11 output) and {\tt postscript} (PostScript output). Both
outputs are compatible. If no {\tt gdl.rc} exists or if it is wrong,
the defaults are read.
\pss\pss


\centerline{\bf The Tracer.}

The program {\tt tracer} makes a film. It takes three arguments: the
file name, the name of the ``engine'' object and the name of the
``moved'' object. It shall move the first one and show the different
dispositions of the whole figure. 

It has not been integrated with the rest of the program yet. Don't
panic: we are at it.
\pss\pss

\centerline{\bf Examples.}

The example files, such as {\tt elipse.gdl}, {\tt hiperb.gdl}, {\tt
chebyshev.gdl} and, above all, {\tt pentagono.gdl}, should give hints
about how to make interesting constructions with this (rather
primitive) version of GDL.
\pss

Please, take a look at the TODO file so as to know what do the
developers consider the principal things to fix. A lot of work is
needed in order to make from this project a full fledged and useful
piece of software. All collaboration is appreciated, from testers
and suggestions to (of course) development.
\pss

Madrid, December 2002.

\bye


