# Line and ConvexHull2D Intersection

**URL:** https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336
**Category:** Development
**Tags:** python, code
**Created:** [April 28, 2023, 5:39am UTC](https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336 "2023-04-28T05:39:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kruvva](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kruvva](https://discourse.vtk.org/u/kruvva)
#### Post date: [April 28, 2023, 5:39am UTC](https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336/1 "2023-04-28T05:39:14Z")

</div>

Hi, I am trying to find out the intersection of a ConvexHull2D and a line using vtkPolyData and vtkLineSource objects with the help of vtkIntersectionPolyDataFilter as shown below:

```
intFilter = vtk.vtkIntersectionPolyDataFilter()
intFilter.SetInputData(0, hullPolyData)
intFilter.SetInputData(1, line.GetOutput())
intFilter.Update()

```

And I get the following error:  
**vtkMath.cxx:797 WARN| vtkMath::Jacobi: Error extracting eigenfunctions**  
**vtkPointLocator.cxx:868 ERR| vtkPointLocator (0000024158EED9A0): No points to subdivide**  
**vtkIntersectionPolyData:2410 WARN| No Intersection between objects**

What am I missing here. They both lie in the XY plane and I see them intersecting when I render.

---

<div class="post-metadata">

### Author: ![kruvva](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kruvva](https://discourse.vtk.org/u/kruvva)
#### Post date: [April 29, 2023, 5:42pm UTC](https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336/2 "2023-04-29T17:42:37Z")

</div>

vtkPolygon.IntersectWithLine() and vtkOBBTree.IntersectWithLine() fails too. Both the line and the hull (polygon) lie in the same (XY) plane.  
Any ideas?

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [May 1, 2023, 12:47pm UTC](https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336/3 "2023-05-01T12:47:55Z")

</div>

I am guessing that since the line and polygon are in the same plane they are parallel. Which likely means that there is a tolerancing issue. I can’t say for sure without seeing code and/or data.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [May 3, 2023, 1:18pm UTC](https://discourse.vtk.org/t/line-and-convexhull2d-intersection/11336/4 "2023-05-03T13:18:40Z")

</div>

Hi,

Try `intFilter.SetTolerance(1.0)` or with some other value.

regards,

PC
