I’m trying to implement a scanline polygon fill using the even/odd technique, but horizontal edges have be perplexed. There are a number of similar questions on the site, but the answers are either a lot more work or simply don’t help.
The most commonly-repeated suggestion is to just ignore horizontal edges, but that fails in the simple case of an upright star:
You can see that the scanline corresponding to the top of the left and right points has four vertices. If the horizontal edges are not considered, then all of those vertices are unshared, which means they are only counted once. That results in the middle part of the line (overlapping the upper point) being left unpainted.
For the even/odd technique to work in this case, we need to count both outer vertices just once each and both inner vertices twice each; then the entire line will be properly filled. But I can’t see how to determine that algorithmically. I feel like there must be a solution short of giving up on even/odd entirely, but I don’t know what it is.