# Unexpected behavoir of FindCellsWithinBounds.

**URL:** https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805
**Category:** Support
**Created:** [September 23, 2019, 2:42pm UTC](https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805 "2019-09-23T14:42:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jason](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@Jason](https://discourse.vtk.org/u/Jason)
#### Post date: [September 23, 2019, 2:42pm UTC](https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805/1 "2019-09-23T14:42:15Z")

</div>

It seems that when the cell size is similar to or larger than one of the dimensions of the bounds, FindCellsWithBounds for the various cell locators returns cells that are outside the bounds. Is this expected behavior, and if so is it documented anyway? Below is an example. The transparent pillar is the bounds passed to FindCellsWithBounds, and the cells returned are marked in red.

 ![findcells1](https://discourse.vtk.org/uploads/default/original/1X/f9fa9ea1d79cb19f9b8ca03cb77c95befee1ba02.png) ![findcells2](https://discourse.vtk.org/uploads/default/original/1X/c8fee7463f736b4425cf46b2f979e359dc552be8.png) ![findcells3](https://discourse.vtk.org/uploads/default/original/1X/c8c14c1a6d7951e8b711e1b0168e8fd804b511d5.png)

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.vtk.org/u/Kenichiro-Yoshimi)
#### Post date: [September 24, 2019, 2:37am UTC](https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805/2 "2019-09-24T02:37:23Z")

</div>

I am afraid that I don’t know the expected and/or appropriate behavior of FindCellsWithinBounds, but it seems that the result of vtkCellTreeLocator is better than other cell locators in my test.  
[FindCellIsWithinBound.7z](https://discourse.vtk.org/uploads/short-url/iyB3YuvahMP3MYoGnZd6JUPabLw.7z) (18.7 KB)

- vtkStaticCellLocator  
number of cells per node: default(35)  
 ![vtkStaticCellLocator_default](https://discourse.vtk.org/uploads/default/original/1X/9a4958992e6f762badd413afc07ef35a8e2104e2.png)

- vtkStaticCellLocator  
number of cells per node: 1  
 ![vtkStaticCellLocator_1](https://discourse.vtk.org/uploads/default/original/1X/2cd66951202a4100ae899245bf047837c1d0c996.png)

- vtkCellTreeLocator  
number of cells per node: 2  
 ![vtkCellTreeLocator](https://discourse.vtk.org/uploads/default/original/1X/a7659a7c557bd9bc89b40a017dd175be2565f2db.png)

Could you try with vtkCellTreeLocator?

---

<div class="post-metadata">

### Author: ![a-jp1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a-jp1/32/1710_2.png) [@a-jp1](https://discourse.vtk.org/u/a-jp1)
#### Post date: [November 29, 2023, 9:23am UTC](https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805/3 "2023-11-29T09:23:28Z")

</div>

Could I ask the developers whether they feel this bug has been squashed? I ask because recently this may/may not appear to have surfaced for our test case on 9.1 and 9.3 branch. Before we debug our work we wanted to check if this was outstanding?  
Thanks  
Andy

---

<div class="post-metadata">

### Author: ![a-jp1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a-jp1/32/1710_2.png) [@a-jp1](https://discourse.vtk.org/u/a-jp1)
#### Post date: [July 31, 2024, 6:04pm UTC](https://discourse.vtk.org/t/unexpected-behavoir-of-findcellswithinbounds/1805/4 "2024-07-31T18:04:01Z")

</div>

Hi, any follow up on whether this has been fixed?

Thanks
