[vtkusers] get a point inside a vtkPolyData

Jonathan Morra jonmorra at gmail.com
Fri Feb 25 13:07:15 EST 2011


But what if I happen to pick an inflection point, then both could fail.

On Fri, Feb 25, 2011 at 10:06 AM, David Doria <daviddoria at gmail.com> wrote:

> 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/f52f8c78/attachment.htm>


More information about the vtkusers mailing list