<div dir="ltr"><div>Why this function is not available in python?</div>
<div> </div>
<div>Jothy<br><br></div>
<div class="gmail_quote">On Thu, Apr 8, 2010 at 12:43 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Tue, Apr 6, 2010 at 11:33 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>> n is the normal to the face of the polygon<br>> numPts is the number of points in the polygon<br>
> pts is an array of xyz points<br><br><br></div>The call was pretty nasty:<br><br><br> double n[3];<br> polygon->ComputeNormal(polygon->GetPoints()->GetNumberOfPoints(),<br>static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),<br>
n);<br><br> double bounds[6];<br> polygon->GetPoints()->GetBounds(bounds);<br><br> cout << "test x in polygon? " << polygon->PointInPolygon(x,<br>polygon->GetPoints()->GetNumberOfPoints(),<br>
static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),<br>bounds, n) << endl;<br><br>I just wrote a convenience function and submitted it to the developers<br>mailing list. If it is approved, in the future you can simply call<br>
<br>cout << "test x in polygon? " << polygon->PointInPolygon(x) << endl;<br><br>Thanks,<br><font color="#888888"><br>David<br></font></blockquote></div><br></div>