2
$\begingroup$

I have a non-convex shape (object) in black on the figure on the link. At the beginning, All red points are outside the shape. Next, I apply a random transformation on some points. This create a new shape (yellow).

What I want is to fill the outside of the shape with a specific color but because of the transformation, some red points are now inside the shape. I would like to know how to find a correct red point, i.e outside the shape to apply the filling algorithm.

Here is the link on the image. http://postimage.org/image/sbjmgi1tr/

  • 0
    @Daryl $Y$ou're right. I just want to do that. I found a way by counting the number of time an horizontal line cross the shape. But this method has a lot of exceptions I have to deal with.2012-09-07

1 Answers 1

0

In that case, use a point in polygon algorithm. Then you can test each point if it is in your new polygon or not.