# How to check if an octant is inside, partially inside, or outside the polydata?

**URL:** https://discourse.vtk.org/t/how-to-check-if-an-octant-is-inside-partially-inside-or-outside-the-polydata/11321
**Category:** Support
**Created:** [April 27, 2023, 4:25am UTC](https://discourse.vtk.org/t/how-to-check-if-an-octant-is-inside-partially-inside-or-outside-the-polydata/11321 "2023-04-27T04:25:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kunal\_Gupta](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kunal_gupta/32/6992_2.png) [@Kunal\_Gupta](https://discourse.vtk.org/u/Kunal_Gupta)
#### Post date: [April 27, 2023, 4:25am UTC](https://discourse.vtk.org/t/how-to-check-if-an-octant-is-inside-partially-inside-or-outside-the-polydata/11321/1 "2023-04-27T04:25:04Z")

</div>

How to check if an octant is inside, partially inside, or outside the polydata?

---

<div class="post-metadata">

### Author: ![Jishnu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jishnu/32/6221_2.png) [@Jishnu](https://discourse.vtk.org/u/Jishnu)
#### Post date: [May 4, 2023, 12:42pm UTC](https://discourse.vtk.org/t/how-to-check-if-an-octant-is-inside-partially-inside-or-outside-the-polydata/11321/2 "2023-05-04T12:42:02Z")

</div>

You can use `vtkSelectEnclosedPoints` if your polydata forms a closed surface.

---

<div class="post-metadata">

### Author: ![Kunal\_Gupta](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kunal_gupta/32/6992_2.png) [@Kunal\_Gupta](https://discourse.vtk.org/u/Kunal_Gupta)
#### Post date: [May 4, 2023, 4:35pm UTC](https://discourse.vtk.org/t/how-to-check-if-an-octant-is-inside-partially-inside-or-outside-the-polydata/11321/3 "2023-05-04T16:35:22Z")

</div>

can you share the code?  
I am not getting it still now  
my approach was to check all 8 vertexes of the octant and if all are inside the octant is inside otherwise partially outside or outside.  
but not getting the correct output from it.
