Am 21.07.2011 16:53, schrieb luigi scarso:
On Thu, Jul 21, 2011 at 4:39 PM, Alan Braslau
wrote: Hello,
I have a question for metapost specialists:
I am looking for some sort of effect, built upon a zig-zag line. The first graphic in the minimal example below is as I would expect. The second graphic seems to be drawn without the point at (0,0). (Ignore the asymmetry at the end of the path in the 2nd, this is to be expected in this minimal example.)
Is the result correct or is this a bug?
Alan
\starttext
\startTEXpage \startMPcode u := 1mm ;
path p[] ; p0 := ((0,0)--(1,0)) rotated 45 scaled 20u ; pickup pensquare scaled 10u rotated 45 ; draw p0 withcolor blue ; pickup pensquare yscaled 2u xscaled 5u rotated 45 ; draw p0 withcolor yellow ; pickup pencircle scaled .1u ; draw p0 ; \stopMPcode \stopTEXpage
\startTEXpage \startMPcode p1 := ((0,0)--(sqrt(2),0)) rotated -30 scaled 20u shifted point infinity of p0 ; p2 := p0--p1 ;
use
p2 := p0 & p1; the reason for the 'unexpected' output is, that point 1 and 2 of the path p2 are equal. keep in mind that drawing with an asymmetrical pen has its own (complex) rules.
pickup pensquare scaled 10u rotated 45 ; draw p2 withcolor blue ; pickup pensquare yscaled 2u xscaled 5u rotated 45 ; draw p2 withcolor yellow ; pickup pencircle scaled .1u ; draw p2 ; \stopMPcode \stopTEXpage
\stoptext
You are shifting by a certain amount : what is the net effect of shifted point infinity of p0 ?
afaik simply the last point of p0.