<div dir="ltr">When I call ComputeNormal I get an error &quot; method requires a vtk object&quot;<br><br>Actually my polygon is from vtkCutter, it cut a slice from the sphere.Should I convert it to some other type?<br><br>
Thanks,<br><br>Jothy<br><br>polygon-&gt;ComputeNormal(contour-&gt;GetPoints()-&gt;<div class="im">GetNumberOfPoints(),<br>
static_cast&lt;double*&gt;(contour-&gt;GetPoints()-&gt;GetData()-&gt;GetVoidPointer(0)),</div><br><br><div class="gmail_quote">On Mon, Apr 12, 2010 at 10:56 AM, Jothybasu K Selvaraj <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hi David,<br><br>I need a bit of clarification as I am not much familiar with c++.<br>
<br><br>double n[3];<b><span style="color: rgb(255, 0, 0);"> // you have declared the variable n</span></b><br><br>
  polygon-&gt;ComputeNormal(<div><div class="im">polygon-&gt;GetPoints()-&gt;GetNumberOfPoints(),<br>
static_cast&lt;double*&gt;(polygon-&gt;GetPoints()-&gt;GetData()-&gt;GetVoidPointer(0)),<br>
</div><b><span style="color: rgb(255, 0, 0);">n);// How do you set this as an input to an argument as it doesn&#39;t hold any value</span></b><br><br>Did you mistyped or am I misinterpreted?<br><br>Thanks,<br><br>Jothy<br>
<br>
<br></div><br><br><div class="gmail_quote"><div class="im">On Thu, Apr 8, 2010 at 12:43 AM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>&gt;</span> wrote:<br>
</div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On Tue, Apr 6, 2010 at 11:33 AM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">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></div></div><br></div>
</blockquote></div><br></div>