A SERVICE OF

logo

EN
Drawing Polygons
21-13
Figure 21-8 Filling Polygons: Even/Odd Fill Method
Non-Zero Winding Fill Method
The
non-zero
winding fill algorithm (fill method 1) determines whether
a point is inside a region enclosed by a line path using the following
steps:
1
Draw a ray from the point across the path segment.
2
Add 1 every time the line segment crosses the ray from left to
right or bottom to top.
3
Subtract 1 every time the segment crosses the ray from right to
left or top to bottom.
4
FP fills the enclosed area in question if the sum of steps 2 and 3
is non-zero. Figure 21-9 illustrates the non-zero winding fill
concept.