[cairo] Visible lines between adjacent semi-transparent polygons

Jennifer Adams jma at cola.iges.org
Mon Nov 21 16:22:25 PST 2011


On Nov 21, 2011, at 3:41 PM, Maarten Bosmans wrote:

> 2011/11/21 Jennifer Adams <jma at cola.iges.org>:
>> Dear Experts,
>> I am working toward implementing Cairo in GrADS, an open source program for
>> the analysis and display of meteorological data. My use of cairo is fairly
>> basic. In a test program, I am drawing two adjacent triangles with
>> transparency set to 0.50, writing out .pdf and .png formats. A faint line
>> shows up along the common boundary of the two triangles (i.e., along the
>> diagonal of what should be a solid rectangle). Disabling anti-aliasing makes
>> the line go away in the .png file, but it persists in the .pdf. What is
>> causing this and is there a remedy?
> 
> Well, for the PDF you're also at the mercy of the renderer. It might
> very well be that it renders incorrectly.
I agree, that is why I test with Acrobat Professional as well as Preview. Anybody have an opinion on which renderer is best? The flip side of that is that many of my users don't have access to good (i.e. costly) renderers, so it really should look okay with the cheesy (i.e., free) ones...

> 
> I sometimes get better results by using a temporary surface
> (push_group), drawing multiple things (with the add operator) and then
> painting the surface with pop_group, paint (wiht the normal over
> operator).
I will look for some examples in the src/test subdirectory and try this technique. 


> 
> And of course, you could consider drawing a rectangle instead of two triangles.
What's the fun in solving it THAT way? Actually, the two triangles are just an extreme over-simplification of the kinds of adjacent polygons we are drawing in GrADS. 
--Jennifer

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20111121/200833fb/attachment.htm>


More information about the cairo mailing list