2.4.1 Class path -- PostScript-like paths

class path( *pathitems)
This class represents a PostScript like path consisting of the path elements pathitems.

All possible path items are described in Sect. 2.4.2. Note that there are restrictions on the first path element and likewise on each path element after a closepath directive. In both cases, no current point is defined and the path element has to be an instance of one of the following classes: moveto, arc, and arcn.

Instances of the class path provide the following methods (in alphabetic order):

append( pathitem)
Appends a pathitem to the end of the path.

arclen( )
Returns the total arc length of the path.$^\dagger$

arclentoparam( lengths)
Returns the parameter value(s) corresponding to the arc length(s) lengths.$^\dagger$

at( params)
Returns the coordinates (as 2-tuple) of the path point(s) corresponding to the parameter value(s) params.$^\ddagger$ $^\dagger$

atbegin( )
Returns the coordinates (as 2-tuple) of the first point of the path.$^\dagger$

atend( )
Returns the coordinates (as 2-tuple) of the end point of the path.$^\dagger$

bbox( )
Returns the bounding box of the path. Note that this returned bounding box may be too large, if the path contains any curveto elements, since for these the control box, i.e., the bounding box enclosing the control points of the Bézier curve is returned.

begin( )
Returns the parameter value (a normpathparam instance) of the first point in the path.

curveradius( param=None, arclen=None)
Returns the curvature radius/radii (or None if infinite) at parameter value(s) params.$^\ddagger$ This is the inverse of the curvature at this parameter. Note that this radius can be negative or positive, depending on the sign of the curvature.$^\dagger$

end( )
Returns the parameter value (a normpathparam instance) of the last point in the path.

extend( pathitems)
Appends the list pathitems to the end of the path.

intersect( opath)
Returns a tuple consisting of two lists of parameter values corresponding to the intersection points of the path with the other path opath, respectively.$^\dagger$ For intersection points which are not farther apart then epsilon points, only one is returned.

joined( opath)
Appends opath to the end of the path, thereby merging the last subpath (which must not be closed) of the path with the first sub path of opath and returns the resulting new path.$^\dagger$

normpath( epsilon=None)
Returns the equivalent normpath. For the conversion and for later calculations with this normpath and accuracy of epsilon points is used. If epsilon is None, the global epsilon of the path module is used.

paramtoarclen( params)
Returns the arc length(s) corresponding to the parameter value(s) params.$^\ddagger$ $^\dagger$

range( )
Returns the maximal parameter value param that is allowed in the path methods.

reversed( )
Returns the reversed path.$^\dagger$

rotation( params)
Returns (a) rotations(s) which (each), which rotate the x-direction to the tangent and the y-direction to the normal at that param.$^\dagger$

split( params)
Splits the path at the parameter values params, which have to be sorted in ascending order, and returns a corresponding list of normpath instances.$^\dagger$

tangent( params, length=1)
Return (a) line instance(s) corresponding to the tangent vector(s) to the path at the parameter value(s) params.$^\ddagger$ The tangent vector will be scaled to the length length.$^\dagger$

trafo( params)
Returns (a) trafo(s) which (each) translate to a point on the path corresponding to the param, rotate the x-direction to the tangent and the y-direction to the normal in that point.$^\dagger$

transformed( trafo)
Returns the path transformed according to the linear transformation trafo. Here, trafo must be an instance of the trafo.trafo class.$^\dagger$

Some notes on the above: