# vtk python poininpolygon method

**URL:** https://discourse.vtk.org/t/vtk-python-poininpolygon-method/3047
**Category:** Support
**Created:** [April 14, 2020, 8:45am UTC](https://discourse.vtk.org/t/vtk-python-poininpolygon-method/3047 "2020-04-14T08:45:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MQChen](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/e19adc/32.png) [@MQChen](https://discourse.vtk.org/u/MQChen)
#### Post date: [April 14, 2020, 8:45am UTC](https://discourse.vtk.org/t/vtk-python-poininpolygon-method/3047/1 "2020-04-14T08:45:58Z")

</div>

Hi ,  
The poininpolygon() method can find in c++, but i can not ues in python (vtk 8.1.2, python3.7).  
This method can ues in python? Where have a example (i search and not result)?  
Thx!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 14, 2020, 12:58pm UTC](https://discourse.vtk.org/t/vtk-python-poininpolygon-method/3047/2 "2020-04-14T12:58:46Z")

</div>

It looks to be a static method. Though 8.1 might be the root cause here. @dgobbi?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [April 14, 2020, 1:29pm UTC](https://discourse.vtk.org/t/vtk-python-poininpolygon-method/3047/3 "2020-04-14T13:29:19Z")

</div>

The PointInPolygon method isn’t wrapped because it has a bare `double *` parameter that isn’t hinted.

One way of doing an inside vs. outside check is [vtkImplicitSelectionLoop](https://vtk.org/doc/nightly/html/classvtkImplicitSelectionLoop.html).

```
loop = vtkImplicitSelectionLoop()
loop.SetLoop(points)
if loop.EvaluateFunction((x, y, z)) < 0.0:
    print("inside")
else:
    print("outside")
```
