<div dir="ltr">When I call ComputeNormal I get an error " method requires a vtk object"<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->ComputeNormal(contour->GetPoints()-><div class="im">GetNumberOfPoints(),<br>
static_cast<double*>(contour->GetPoints()->GetData()->GetVoidPointer(0)),</div><br><br><div class="gmail_quote">On Mon, Apr 12, 2010 at 10:56 AM, Jothybasu K Selvaraj <span dir="ltr"><<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>></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->ComputeNormal(<div><div class="im">polygon->GetPoints()->GetNumberOfPoints(),<br>
static_cast<double*>(polygon->GetPoints()->GetData()->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'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"><<a href="mailto:daviddoria%2Bvtk@gmail.com" target="_blank">daviddoria+vtk@gmail.com</a>></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 <<a href="mailto:bill.lorensen@gmail.com" target="_blank">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></div></div><br></div>
</blockquote></div><br></div>