Given a set C of planar curves, the arrangement A(C) is the
subdivision of the plane into zero-dimensional, one-dimensional and
two-dimensional cells, called vertices, edges and faces, respectively,
induced by the curves in C. Arrangements are ubiquitous in the
computational-geometry literature and have many applications
in fields like motion planning, computer-aided design, geographical
information systems, etc.

The curves in C can intersect each other (a single curve may also
be self-intersecting or may be comprised of several disconnected
branches) and are not necessarily x-monotone. We construct a
collection C'' of x-monotone subcurves that are pairwise disjoint in
their interiors. We do it in two steps as follows. First, we decompose
each curve in C into maximal x-monotone subcurves (and possibly
isolated points), obtaining the collection C'. Note that an x-monotone
curve cannot be self-intersecting. Then, we decompose each curve in
C' into maximal connected subcurves not intersecting any other curve
(or point) in C'. The collection C'' may also contain isolated points,
if the curves of C contain such points. The arrangement induced by the
collection C'' can be conveniently embedded as a planar graph, whose
vertices are associated with curve endpoints or with isolated points,
and whose edges are associated with subcurves. It is easy to see that
A(C) = A(C''). This graph can be represented using a doubly-connected
edge list data-structure (DCEL for short), which consists of
containers of vertices, edges, and faces and maintains the incidence
relations among these objects.

This package can be used to construct, maintain, alter, and display
arrangements in the plane. Once an arrangement is constructed, the
package can be used to obtain results of various queries on the
arrangement, such as point location. The package also includes generic
implementations of two algorithmic frameworks, that are, computing the
zone of an arrangement, and line-sweeping the plane, the arrangements
is embedded on. These frameworks are used in turn in the
implementations of other operations on arrangements. Computing the
overlay of two arrangements, for example, is based on the sweep-line
framework.

Arrangements and arrangement components can also be extended to store
additional data. An important extension stores the construction
history of the arrangement, such that it is possible to obtain the
originating curve of an arrangement subcurve.
