<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">&lt;<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>&gt;</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 &lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt; wrote:<br>&gt; n is the normal to the face of the polygon<br>&gt; numPts is the number of points in the polygon<br>
&gt; pts is an array of xyz points<br><br><br></div>The call was pretty nasty:<br><br><br> double n[3];<br> polygon-&gt;ComputeNormal(polygon-&gt;GetPoints()-&gt;GetNumberOfPoints(),<br>static_cast&lt;double*&gt;(polygon-&gt;GetPoints()-&gt;GetData()-&gt;GetVoidPointer(0)),<br>
n);<br><br> double bounds[6];<br> polygon-&gt;GetPoints()-&gt;GetBounds(bounds);<br><br> cout &lt;&lt; &quot;test x in polygon? &quot; &lt;&lt; polygon-&gt;PointInPolygon(x,<br>polygon-&gt;GetPoints()-&gt;GetNumberOfPoints(),<br>
static_cast&lt;double*&gt;(polygon-&gt;GetPoints()-&gt;GetData()-&gt;GetVoidPointer(0)),<br>bounds, n) &lt;&lt; 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 &lt;&lt; &quot;test x in polygon? &quot; &lt;&lt; polygon-&gt;PointInPolygon(x) &lt;&lt; endl;<br><br>Thanks,<br><font color="#888888"><br>David<br></font></blockquote></div><br></div>