0

Alternate overlapping areas of shape are not getting filled with same color. But instead its white.

Sample code

from turtle import *
color('black', 'yellow')    
begin_fill()
circle(40)
circle(60)
circle(80)
end_fill()

Why is not completely getting filled by same color ??

Lijo Jose
  • 317
  • 1
  • 3
  • 13
  • I'm not sure what the issue is. If I run your code, I get 3 circles which all get filled yellow once the turtle stops moving. [See it here. (Goes to i.ibb.co)](https://i.ibb.co/KjwsLxj/stackanswer.png) – aargon Jan 19 '20 at 21:53
  • There might be an issue with your turtle interpreter, or with how you're viewing it. If you add mainloop() at the end of the code, you can see the final image for as long as you want, if that helps. – aargon Jan 20 '20 at 00:24
  • @aargon. I am expecting as your image but what I am seeing is different. I am using ubuntu@python3.7.4 https://ibb.co/jG0bCBz – Lijo Jose Jan 20 '20 at 00:59
  • I believe this problem has come up before in the context of [filling a star](https://stackoverflow.com/a/43316604/5771269). The tkinter underpinnings in Unix and Windows environments differ on how overlapping fill is handled. – cdlane Jan 21 '20 at 00:30
  • 1
    Duplicate. The graphics systems of Unix and Windows handle filling of self-intersecting polygons differently. (Not well documented.) On Windows, if one draws a line from the outside to a particular region without going through an intersection, each line crossing toggles 'fill', starting with 'off' in the outside. Side note: Spencer-Brown's "Laws of Form" derives boolean algebra from the observation that repetition can either confirm or negate. – Terry Jan Reedy Jan 24 '20 at 22:18
  • 1
    The difference between Windows and Unix seems to be reversed for separate overlapping items, as in this question. Your post on bugs.python.org indicates that you are using Ubuntu. On Windows, the circles are all filled in, while the middle circle is not on Ubuntu and macOS. – Terry Jan Reedy Jan 24 '20 at 23:17
  • I think this behavior is worth documenting to avoid confusion – Lijo Jose Jan 25 '20 at 03:39
  • Paragraph added in https://bugs.python.org/issue39392. – Terry Jan Reedy Jan 27 '20 at 23:49

0 Answers0