Parity Fill
Problem:
    For each pixel determine if it is inside or outside of a given polygon.
Approach:
  • from the point being tested cast a ray in an arbitary direction
  • if the number of crossings is odd then the point is inside
  • if the number of crossings is even then the point is outside



  • Very fragile algorithm
  • What if ray crosses a vertex?
  • What if ray falls on an edge?
  • Commonly used in ECAD
  • Suitable for H/W
Lecture 4   Slide 6   6.837 Fall '00