in reply to Re: Re: OT: point inside polyhedron test
in thread OT: point inside polyhedron test

An anternative is to be careful with your inequalities. If the list of verticies follows a path, then you can simply exclude the endpoint that was part of the previous segment. --Dave
  • Comment on Re: Re: Re: OT: point inside polyhedron test

Replies are listed 'Best First'.
Re: Re: Re: Re: OT: point inside polyhedron test
by Dr. Mu (Hermit) on Feb 19, 2003 at 21:45 UTC
    Yes, that's true, except in the case where both endpoints are intersected. You still have to check for this and discard such a segment from the count:
    *----------* | | | | A=1 | | | @====X-----X==========> | B=0 | | | C=0 | | *----------------*
    Moving clockwise, the second endpoint on A counts, since it wasn't part of the previous segment. If we counted the second endpoint of B, however, we'd end up with an even number, because this point cannot also count in C. So we have to discard segment B entirely.
      You're right, and we mustn't forget anther nasty case:
        
      
        @=======*=====>
               / \
              /   \
             /_____\
      
      
      Here, we want to count the end-point twice! Endpoints are nasty. If you intersect one, you need to be careful. --Dave