[vtkusers] get a point inside a vtkPolyData

David Doria daviddoria at gmail.com
Fri Feb 25 13:06:03 EST 2011


On Fri, Feb 25, 2011 at 1:00 PM, Jonathan Morra <jonmorra at gmail.com> wrote:

> I understand everything except the last part.  How do I know if I move
> epsilon along the vector I have my point?
>
>
Consider a unit circle as the polygon, and that you have the point (0,1) on
the polygon. Say you picked the vector (.5, .5). You could move to a new
point

(0,1) + epsilon * normalize( (.5,.5) )

and do the point-in-polygon test. It will fail in this case (if it passes,
you're done). So instead, move to the point

(0,1) - epsilon * normalize( (.5,.5) )

and it should be inside the polygon.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110225/5e14cd4d/attachment.htm>


More information about the vtkusers mailing list