[vtkusers] PoinInPolygon arguments
Jothybasu K Selvaraj
jothybasu at gmail.com
Thu Apr 8 07:06:02 EDT 2010
Why this function is not available in python?
Jothy
On Thu, Apr 8, 2010 at 12:43 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:
> On Tue, Apr 6, 2010 at 11:33 AM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> > n is the normal to the face of the polygon
> > numPts is the number of points in the polygon
> > pts is an array of xyz points
>
>
> The call was pretty nasty:
>
>
> double n[3];
> polygon->ComputeNormal(polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> n);
>
> double bounds[6];
> polygon->GetPoints()->GetBounds(bounds);
>
> cout << "test x in polygon? " << polygon->PointInPolygon(x,
> polygon->GetPoints()->GetNumberOfPoints(),
> static_cast<double*>(polygon->GetPoints()->GetData()->GetVoidPointer(0)),
> bounds, n) << endl;
>
> I just wrote a convenience function and submitted it to the developers
> mailing list. If it is approved, in the future you can simply call
>
> cout << "test x in polygon? " << polygon->PointInPolygon(x) << endl;
>
> Thanks,
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100408/211f5e7f/attachment.htm>
More information about the vtkusers
mailing list