2.4.3 Class normpath

The normpath class is used internally for all non-trivial path operations, i.e. the ones marked by a $\dagger$ in the description of the path above. It represents a path as a list of subpaths, which are instances of the class normsubpath. These normsubpaths themselves consist of a list of normsubpathitems which are either straight lines (normline) or Bézier curves (normcurve).

A given path can easily be converted to the corresponding normpath using the method with this name:

np = p.normpath()
Additionally, you can specify the accuracy (in points) which is used in all normpath calculations by means of the argument epsilon, which defaults to to $10^{-5}$ points. This default value can be changed using the module function path.set.

To construct a normpath from a list of normsubpath instances, you pass them to the normpath constructor:

class normpath( normsubpaths=[])
Construct a normpath consisting of subnormpaths, which is a list of subnormpath instances.

Instances of normpath offers all methods of regular paths, which also have the same semantics. An exception are the methods append and extend. While they allow for adding of instances of subnormpath to the normpath instance, they also keep the functionality of a regular path and allow for regular path elements to be appended. The later are converted to the proper normpath representation during addition.

In addition to the path methods, a normpath instance also offers the following methods, which operate on the instance itself, i.e., modify it in place.

join( other)
Join other, which has to be a path instance, to the normpath instance.

reverse( )
Reverses the normpath instance.

transform( trafo)
Transforms the normpath instance according to the linear transformation trafo.

Finally, we remark that the sum of a normpath and a path always yields a normpath.