[metapost] Problem in SVG output?

Shriramana Sharma samjnaa at gmail.com
Sun Aug 5 17:58:47 CEST 2012


I drew a simple triangle using an elliptical pen rotated by 60
degrees. The PS output is fine, but the SVG output apparently rotates
the pen *clockwise* by 60 degrees because the top-right side of the
triangle is the thinner stroke instead of the top left.

I think it has something to do with applying transformation to the
coordinate system instead of the object. I do not know SVG enough to
know whether it is possible to assign per object transformations, or
whether all per-object transformations are to be achieved by sort of
pushing the current coordinate system transform state onto a stack,
altering it as per requirements temporarily (with intended object
rotations to be applied in reverse), drawing and then popping back the
previous state from the stack. (Qt does all per-object transforms this
way.) In this case, the SVG output system of MPost/MPLib should take
care to reverse the sign of all angles before outputting. Perhaps
since MPost was designed initially for PostScript, it follows the PS
model of applying per-object transforms, but apparently the case with
SVG is different and should be fixed.

Shriramana Sharma
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp-svgout-problem.zip
Type: application/zip
Size: 6822 bytes
Desc: not available
URL: <http://tug.org/pipermail/metapost/attachments/20120805/2370468e/attachment-0001.zip>

More information about the metapost mailing list