Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 9b3ef98d82282343cfac7f840aa5ab34 > files > 355

PyX-0.11.1-1.fc15.i686.rpm

Splitting paths

In this example we use the `split` method of a path to split it into several
paths. Similar to the `at` method you can pass a list of numbers to the split
method (or PyX length instances) to specify the splitting point by the arc
length ... or you can use parametrization instances like the one returned by
the `end` method, where you can substract a length to conventiently express a
certain location measured from the end of the path.

For a single splitting point, you can also pass the parameter directly instead
of warpping this single value into a list. Note, however, that the return value
of the `split` method is always a list; splitting a non-closed path at one
point still yields two segments.

! When splitting at the beginning or the end of the path, one segment may
be empty. Still PyX returns a corresponding path of length 0.

! When splitting at non-closed subpaths the result of the split method
will be a list containing one path more than the number of splitting
points. However, for a closed subpath a splitting at a single point
will open the subpath but return a single path only. Consider a circle
which you split at a single value: The result will still be a circle,
but the path will not be closed anymore.