From mdsumner at gmail.com  Wed Aug  3 08:24:14 2016
From: mdsumner at gmail.com (Michael Sumner)
Date: Wed, 3 Aug 2016 06:24:14 +0000
Subject: [Rd] polypath winding rule with transparency
Message-ID: <CAAcGz99g-zD9AHSg-6=fgBPMtCOzwykO0YRXa+Yqm4x5QePSJg@mail.gmail.com>

Hi, I see different results in png() and pdf() for polypath() on Windows
when using the "winding" rule

## overlapping, both clock-wise
x <- cbind(c(.1, .1, .6, .6, NA, .4, .4, .9, .9),
          c(.1, .6, .6, .1, NA, .4, .9, .9, .4))

pfun <- function() {
  plot(x)
  polypath(x * 0.8 + 0.2,  rule = "winding", col = "#BEBEBE80")
  polypath(x,  rule = "winding", col = "#BEBEBE80")
}

## output  "windows.png/pdf" or "unix.png/pdf"
label <- .Platform$OS.type
png(sprintf("%s.png", label))
pfun()
dev.off()
pdf(sprintf("%s.pdf", label))
pfun()
dev.off()


Visually, the result in the "windows.png" file is as if the "evenodd" rule
was specified. All other examples unix.pdf, unix.png, windows.pdf give me
the expected result - which is "all bounded regions shaded grey, with two
tones for the different regions of overlap". The unexpected result is the
completely transparent region.

Is this a known/expected difference on Windows?  I see the unexpected
result in 3.3.1 and in R version 3.3.1 Patched (2016-07-27 r70991) on
Windows.

Cheers, Mike.
-- 
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

	[[alternative HTML version deleted]]



[Rd] polypath winding rule with transparency
Michael Sumner