Re: Shouldn't Cairo use/offer degrees rather than radians?

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.lib.cairo
Organization Geek Central
Message-ID <[email protected]>
On Wed, 28 Jun 2017 07:05:13 +0200, David Kastrup wrote:

> The inability to reliably draw a half circle that seamlessly connects
> with another half circle under any rasterization seems more important
> in my book.

I don’t understand the problem. I just tried the following quick
program:

    import sys
    import os
    import qahirah as qah
    from qahirah import \
        CAIRO, \
        Colour, \
        Vector

    fig_dimensions = Vector(100, 100)
    dpi = 720
    pix = qah.ImageSurface.create \
      (
        format = CAIRO.FORMAT_RGB24,
        dimensions = round(fig_dimensions * dpi / qah.base_dpi)
      )
    ctx = \
        (qah.Context.create(pix)
            .scale(dpi / qah.base_dpi)
            .set_source_colour(Colour.grey(1))
            .set_operator(CAIRO.OPERATOR_SOURCE)
            .paint()
            .set_source_colour(Colour.grey(0))
            .set_line_width(4)
            .set_operator(CAIRO.OPERATOR_OVER)
        )
    (ctx
        .arc(centre = (25, 25), radius = 20, angle1 = -180 * qah.deg, angle2 = 0, negative = False)
        .stroke()
        .arc(centre = (25, 25), radius = 20, angle1 = 0, angle2 = 180 * qah.deg, negative = False)
        .stroke()
    )
    (ctx
        .move_to((75, 25))
        .line_to((75, 50))
        .stroke()
        .move_to((75, 50))
        .line_to((75, 75))
        .stroke()
    )

    pix \
        .flush() \
        .write_to_png("%s.png" % os.path.basename(sys.argv[0]))

The output PNG file I got is enclosed. Can you see any seams in the
rasterization? Because I can’t.

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
connect_segments.png (image/png, 22.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.