On Wed, Sep 12, 2007 at 10:12:46AM -0400, Webb Roberts wrote:
> What is the easiest way to get a Venn diagram in Groff?  Pic doesn't
> seem to like overlapping shapes.

You can get away with hatching.
I attached the file that does a simple variant of that.

Best regards,

        Zvezdan
.PS
.fam H
define hatch_circle {
        pi = atan2(0, -1)
        start = $1
        end = start + 6
        opposite = 2 * start + 16
        for i = start to end do {
                dxr = circlerad * cos(i * pi/16)
                dyr = circlerad * sin(i * pi/16)
                dxl = circlerad * cos((opposite-i) * pi/16)
                dyl = circlerad * sin((opposite-i) * pi/16)
                line from last circle.c + (dxr, dyr) \
                        to last circle.c + (dxl, dyl) colour "$2"
                line from last circle.c + (-dxr, -dyr) \
                        to last circle.c + (-dxl, -dyl) colour "$2"
        }
}
circle outline "red"
hatch_circle(0, red)
circle with .c at last circle.c + (circlerad, 0) outline "blue"
hatch_circle(4, blue)
circle with .c at last circle.c + (-circlerad/2, -circlerad) outline "green"
hatch_circle(8, green)
.PE

Reply via email to