0
12kviews
What is the purpose of inside outside Tests? Explain with an example. OR Explain inside outside test used in filling algorithm.
1 Answer
2
450views

Inside and Outside Tests :-

Once the polygon is entered in the display file, we can draw the outline of the polygon. To show polygon as a solid object we have to set the pixels inside the polygon as well as pixels on the boundary of it.Now the question is how to determine whether or not a point is inside of a polygon. One simple method of doing this is to construct a line segment between the point in question and a point known to be outside the polygon, as shown in the figure (a). Now count how many intersections of the line segment with the polygon boundary occur. If there are an odd number of intersections, then the point in question is inside; otherwise it is outside. This method is called the even-odd method of determining polygon inside points.

enter image description here

As shown in figure (b) , If the intersection point is vertex of the Polygon then we have to look at the other endpoints of the two segments which meet at this vertex. If these points lie on the same side of the constructed line, then the point in question counts as an even number of intersections. If they lie on opposite sides of the constructed line, then the point is counted as a single intersection.

Please log in to add an answer.