typo
[PyX/mjg.git] / examples / drawing2 / smoothed.txt
blobf44547ebf47376e5ab078a57bd0c72000620c1bd
1 Smoothing paths
3 This example shows how to use the `deformer` class. A deformer takes an
4 original path and return a modified one, which is here a smoothed variant. The
5 deformer can be used like any other attribute when stroking or filling a path.
7 Here, we show the use of `deformer.smoothed`, which smoothes away corners in
8 the original path. ... It operates on the `pathitem`s of the original path and
9 cuts out pieces of a given length (`1.0` in the example) surrounding a corner
10 and replaces them by a smooth curve. This new curve is determined to be
11 ''geometrically smooth'', exhibiting the same tangents and curvatures as the
12 original path at the connection points. Alltogether, the smoothing is performed
13 not in a strictly ''geometrical'' sense but also depends on the
14 parameterization of the path. If you try to smooth a path consisting of many
15 short path elements, nothing will really change.
17 ! In all deformers, the deformed path can be accessed directly by
19     ps = deformer.smoothed(1.0).deform(p)