lightning and grid support on surface; cleanups
[PyX/mjg.git] / examples / drawing2 / parallel.txt
blob70e90dbd1238589c0b8cd3ed1293d855dd7826a8
1 Paths with constant distance
3 This example shows how to use the `deformer.parallel` class. It provides the
4 path which has always constant (signed) distance to an original path. ...
6 The correct geometrical solution to the "constant distance" problem is that a
7 corner of the original curve gets surrounded by an arc. As an alternative, you
8 can make the deformer deviate from the strict geometrical interpretation with
9 the argument
11     `sharpoutercorners=1`
13 The resulting parallel path will then exhibit corners with the same angle as
14 the original path does.
16 !! The parallel deformer tries to find the parallel path which consists of as
17 few path elements as possible. This is a striking feature of the parallel
18 deformer, resulting in small EPS and PDF files, as well as in paths which can
19 be processed further in PyX. In the example, the parallel curves for the curved
20 right part of the original path consists of a single Bézier curve only.
22 ! Note that the order of the deformer attributes is not arbitrary, since the
23 deforming operations do not commute. If you want first to smooth and then get
24 the parallel curve to the smoothed curve, you have to say
26     [deformer.smoothed(radius), deformer.parallel(dist)]
28 since the stroke attributes are evaluated from left to right.