Paths

Subpaths and segments

If a path segment is directly added to a path p which is
empty or whose last subpath is closed, a
new subpath is automatically started with Vg.P.subP2.o p.

In the functions below the default value of the optional
argument rel is false. If true, the points given to the
function are expressed relative to the last
point of the path or Gg.P2.o if the path is empty.

earc large cw a r pt p is p with an elliptical arc from
p's last point to pt. The ellipse is defined by the
horizontal and vertical radii r which are rotated by a with
respect to the current coordinate system. If the parameters do not
define a valid ellipse (points coincident or too far apart, zero
radius) the arc collapses to a line.

In general the parameters define four possible arcs, thus
large indicates if more than pi radians of the arc is to be
traversed and cw if the arc is to be traversed in the
clockwise direction (both default to false). In the following
image, in red, the elliptical arc from the left point to the
right one. The top row is ~large:false and the left column
is ~cw:false:

fold ~rev f acc p, applies f to each subpath and subpath segments
with an accumulator. Subpaths are traversed in the order they
were specified, always start with a `Sub, but may not be
`Closed. If rev is true (defaults to false) the segments
and subpaths are traversed in reverse order.