[metapost] Re: workaround for turningnumber bug

Taco Hoekwater taco at elvenkind.com
Thu Feb 3 11:02:16 CET 2005

Hi Larry,

Thank you, that was very helpful.
I do not feel exactly like: "ohhhh, I see!", but I understand
much better than before.

Larry Siebenmann wrote:
> Me=LS> (1) politely refuse paths that mathematically speaking have no
>>turning number. These are

I slowly start to realize that the "mathematical" turning number is
not precisely the same as a "geometric perception" of the turning

> To decide when a path passes through the origin ask mp when
> the path intersects the origin -- using 'intersectiontime'.

Just in case you missed that: intersectiontimes does not truly
solve intersections, it approximates them, so this answer will
also be  an approximation of the truth.

   path p,q,r;
   p = (0,100)--(100,0);
   r = (-200eps,100-200eps)--(100-200eps,-200eps);
   q = (-201eps,100-201eps)--(100-201eps,-201eps);
   show p intersectiontimes r;
   show p intersectiontimes q;
   >> (0,0)
   >> (-1,-1)

I'm not sure whether that matters so I thought I'd better
mention it, just in case.

LS> A 180 degree corner is a -180 degree corner
> so turning number is undefined.

Yes, I'm sorry. Just to make sure I understand this: we could
make this work by allowing turning numbers of "1.5", right?

I am not implying it should, but i can imagine a "turningangle"
primitive that would return a value like this.

Greetings, Taco

More information about the metapost mailing list