[cairo] Difference in Cairo and Qt4 adjacent polygon rendering

Hezekiah M. Carty hcarty at atmos.umd.edu
Fri May 1 11:31:10 PDT 2009


On Fri, May 1, 2009 at 1:27 PM, Emmanuel Pacaud
<emmanuel.pacaud at lapp.in2p3.fr> wrote:
> Le vendredi 01 mai 2009 à 12:04 -0400, Hezekiah M. Carty a écrit :
>> To put it simply, the various Cairo-based vector output formats (PDF,
>> PS, ...) leave seams between adjacent polygons when viewed with
>> Evince.  The Qt4-based outputs do not have these seams, even when
>> viewed with Evince (see the above page for an example).  Both the
>> Cairo and Qt4 rendering devices in PLplot are provided with the same
>> input data and, as far as I can tell, they follow similar paths to
>> produce the final result.
>
> I have opened the files with inkscape (using pdf import), and there's a
> difference in the two files that explains the visual difference when
> viewed with evince: in the qt output, the polygon are not only filled,
> but also stroked, which is not the case in the cairo output. The stroke
> makes the polygons intersect and then suppress the seams.

Emmanuel,

Thank you!  That is good to know and something I did not think to try.
 A stroke around the polygon edges is the workaround used by default
in the PLplot Cairo driver.  So it is good to know that it is not far
off from the Qt4 case.

That said, when the stroke is added in the Cairo case, it creates a
sort of saw-tooth pattern along the edge of some plots (see [1]
below).  This does not happen in the Qt4 output (see [2] below).  In
this case, the polygons which make up the plotted surface do not seem
to be stroked in the Qt4 output, according to Inkscape.  They do,
however, render cleanly (and without the "sawtooth" effect) in Evince.
 Cairo output without the outline stroke does not render cleanly,
again showing seams between the polygons.

[1] - http://www.atmos.umd.edu/~hcarty/example_plots/plplot-example-16-cairo.pdf
[2] - http://www.atmos.umd.edu/~hcarty/example_plots/plplot-example-16-qt4.pdf

Any suggestions for fixing this sawtooth problem?

Thank you again for your time on this.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science


More information about the cairo mailing list