[tex-k] Dvips/epic/eepic rounding issues

Tomas G. Rokicki rokicki at CS.Stanford.EDU
Sun Jan 16 01:28:36 CET 2005


Howdy, everyone!

I recently received some mail from a mathemtician using epic/eepic to
render some very sweet graphics.  Unfortunately, dvips was rendering
these graphics very badly, mispositioning some elements significantly
(about a quarter of an inch in some cases).

The problem turns out to be the pervasive use of rounding and integers
throughout drawPS.c.  This code is 20 years old, so the bug has been
there all along.  Especially with spline paths, error can accumulate
with all the integer roundings causing severe mispositioning.

To fix this, I have a new version of drawPS.c that eschews integer
math throughout, using doubles almost exclusively.  On the diagrams
I've been able to find, it looks fine.  But the changes are somewhat
extensive if mechanical, and I'm terribly afraid to break other graphs
because of a typo or some other mistake on my part.

Is there a repository of eepic/epic graphics that I can use to gain
more confidence in the fix?  Perhaps someone familiar with this macro
package would be willing to take a look at my changes?

As a temporary step, I've checked in the new drawPS.c as "ndrawPS.c"
where it won't be picked up by the build process, but you can copy
it over drawPS.c to see what the impact is.

Any suggestions on how we can best test this in hopes of getting it
into the new dvipsk, and thus into homes worldwide, would be greatly
appreciated.

-tom



More information about the tex-k mailing list