Download A User's Manual for MetaPost
Transcript
8
3 CURVES
2
2
2
1
1
1
0
c=0
0
c=1
0
c=2
2
1
0
c=∞
Figure 11: Results of draw z0{curl c}..z1..{curl c}z2 for various values of the curl parameter c.
of path syntax in Figure 12 includes everything discussed so far including the -- and ... constructions which [4] shows to be macros rather than primitives. A few comments on the semantics are in
order here: If there is a non-empty hdirection specifieri before a hpath knoti but not after it, or vice
versa, the specified direction (or curl amount) applies to both the incoming and outgoing path segments. A similar arrangement applies when a hcontrolsi specification gives only one hpair primaryi.
Thus
..controls (30,20)..
is equivalent to
...controls (30,20) and (30,20)..
hpath expressioni → hpath subexpressioni
| hpath subexpressionihdirection specifieri
| hpath subexpressionihpath joini cycle
hpath subexpressioni → hpath knoti
| hpath expressionihpath joinihpath knoti
hpath joini → -| hdirection specifierihbasic path joinihdirection specifieri
hdirection specifieri → hemptyi
| {curl hnumeric expressioni}
| {hpair expressioni}
| {hnumeric expressioni,hnumeric expressioni}
hbasic path joini → .. | ... | ..htensioni.. | ..hcontrolsi..
htensioni → tensionhnumeric primaryi
| tensionhnumeric primaryiandhnumeric primaryi
hcontrolsi → controlshpair primaryi
| controlshpair primaryiandhpair primaryi
Figure 12: The syntax for path construction
A pair of coordinates like (30,20) or a z variable that represents a coordinate pair is what
Figure 12 calls a hpair primaryi. A hpath knoti is similar except that it can take on other forms
such as a path expression in parentheses. Primaries and expressions of various types will be discussed
in full generality in Section 5.