[metapost] MF interpolation instability

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Thu Jun 20 10:24:55 CEST 2013

Dear colleagues,

a "pendant" to my "pendant" to Stephan Hennig's raport
I sent yesterday (subject: "polygonal pen bugs").

The infinity-like loop that appears in my illustrations
is not an MP bug but the intrinsic MF feature; namely,
it is related to the instability of the MF interpolation
algorithm (devised by J. D. Hobby). In my paper
about the interpolation (just submitted to the TUGboat editors)
I briefly discuss the problem which unavoidably emerges whenever
the algorithm has to deal with the angles nearly equal 180 degree.
In such cases, angles ca. 180 and ca. -180 degree may be likely
used interchangeably.

Attached you'll find the example of such a behavior (note
that the square pen is handled properly); below there are
the relevant sources.

% file pensquarx.mf
mode_setup; designsize:=10pt#; u=1/4pt; u#=1/4pt#;
beginchar("a", 255u#,55u#,55u#);
   save p, sqpen;
   pen sqpen; sqpen := pensquare scaled 10u;
   path p[];
   p1 := (origin..(100u,0){up}..cycle) shifted (5u,0);
   p2 := (origin..(100u,0){down}..cycle) shifted (150u,0);
   draw p1 withpen sqpen;
   draw p2 withpen sqpen;

% file pensquarx.tex
\nopagenumbers \font\g pensquarx scaled 5000 \g a \end

Cheers -- Jacko

  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pensquarx.pdf
Type: application/pdf
Size: 5145 bytes
URL: <http://tug.org/pipermail/metapost/attachments/20130620/829fc7d3/attachment.pdf>

More information about the metapost mailing list