# SelectEnclosedPoints Tolerance

**URL:** https://discourse.vtk.org/t/selectenclosedpoints-tolerance/1161
**Category:** Support
**Created:** [June 17, 2019, 12:22pm UTC](https://discourse.vtk.org/t/selectenclosedpoints-tolerance/1161 "2019-06-17T12:22:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Caroline](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@Caroline](https://discourse.vtk.org/u/Caroline)
#### Post date: [June 17, 2019, 12:22pm UTC](https://discourse.vtk.org/t/selectenclosedpoints-tolerance/1161/1 "2019-06-17T12:22:21Z")

</div>

Dear Forum,  
I am looking for help in understanding how the tolerance for vtkSelectEnclosedPoints works please.  
I have been using vtkSelectEnclosedPoints to identify which points on a rectilinear grid lie within a vtkPolyData set. It works I expect until the points of the rectilinear grid lie on the facets of the polydata.

I have created a simplified example using a 2 x 2 x 2 Box Source centred on 0,0,0 cleaned with the Clean filter to ensure it is a closed surface as my PolyData (green Surface). The rectilinear grid has 16x16x16 cells with dimensions 4 x 4 centred on 0,0,0 (wireframe). I used the output from vtkSelectEnclosedPoints as a variable on the rectilinear grid and used a Threshold of 0.5 to view my results (Grey Surface with Edges).

With the default tolerance for vtkSelectEnclosedPoints of 0.0001 I get this  
 ![image](https://discourse.vtk.org/uploads/default/original/1X/c1fb88ef64bb43d74028f4bb5e2843706f3786fe.png)

With the default tolerance for vtkSelectEnclosedPoints of 0.1 I get this  
 ![image](https://discourse.vtk.org/uploads/default/original/1X/e1cae671b8b2399dcb082611da472792aa481e74.png)

Tolerance = 1.0 and I get what I expected  
 ![image](https://discourse.vtk.org/uploads/default/original/1X/6ea6737e4d53b3cc1ed2bcd11b21dec6921d9e21.png)

Unfortunately on a slightly more complex shape I have a choice of missing cells or outliers. Ship is 100 long, rectilinear cells are cells have 0.5 edge length  
Tolerance = 1.0  
 ![image](https://discourse.vtk.org/uploads/default/original/1X/3019bfbadd3e53550c78bfabbfb77f495c97ffb0.jpeg)

Can anyone give me any ideas as to how I get the tolerance to behave in the same way for each point please?

Thank You

Caroline

---

<div class="post-metadata">

### Author: ![Jay](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@Jay](https://discourse.vtk.org/u/Jay)
#### Post date: [January 2, 2020, 11:13pm UTC](https://discourse.vtk.org/t/selectenclosedpoints-tolerance/1161/2 "2020-01-02T23:13:19Z")

</div>

The comment posted here by @lorensen may be of some help.  
[http://vtk.1045678.n5.nabble.com/vtkSelectEnclosedPoints-filter-inconsistent-output-of-IsInside-method-td5728587.html](http://vtk.1045678.n5.nabble.com/vtkSelectEnclosedPoints-filter-inconsistent-output-of-IsInside-method-td5728587.html)
