Graphics Programs Reference
In-Depth Information
Line joins, dash patterns, and line caps are summarized in Table 5-3 , Table 5-4 , and
Table 5-5 , respectively.
Paths may be made from more than one subpath , each subpath starting with the m
operator. This can be used to define a single path made from several discontiguous
shapes.
Table 5-3. Line joins
Join number
Meaning
0
Mitered join
1
Rounded join
2
Beveled join
Table 5-4. Dash patterns
Dash pattern specification
Meaning
[] 0
Solid line
[2] 0
2 on, 2 off, 2 on...
[2] 1
1 on, 2 off, 2 on... (phase is set to 1)
[2 3] 0
2 on, 3 off, 2 on...
Table 5-5. Line caps
Cap number
Meaning
0
Butt caps. Squared off at the end of the line.
1
Round caps. Semicircles attached at the end of each line.
2
Projecting square caps. Projects at end of line for half the width of the line, and is then squared off.
Bézier Curves
As well as straight lines, we can draw curves. There are many different possible schemes
for defining curves, but the industry has settled on Bézier curves, named for the auto-
mobile engineer Pierre Bézier. They are easy and predictable to manipulate with the
mouse onscreen, relatively easy to draw at any resolution or accuracy, and simple to
define mathematically.
A curve is defined by four points—the start and end points, and two control points
which define how the curve is shaped between start and end. The curve does not nec-
essarily pass through the control points, but always sits fully inside the convex quad-
rilateral defined by its four points.
An example curve, showing the start and end points and the two control points (shown
with dotted lines from the end points, as they may be represented in a graphics editor)
can be seen in Figure 5-3 . This was generated by using the c operator:
Search WWH ::




Custom Search