# How to avoid or repair non-manifold edge when using vtkClipDataSet?

**URL:** https://discourse.vtk.org/t/how-to-avoid-or-repair-non-manifold-edge-when-using-vtkclipdataset/9279
**Category:** Support
**Tags:** python
**Created:** [September 5, 2022, 8:57am UTC](https://discourse.vtk.org/t/how-to-avoid-or-repair-non-manifold-edge-when-using-vtkclipdataset/9279 "2022-09-05T08:57:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![altair0985](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@altair0985](https://discourse.vtk.org/u/altair0985)
#### Post date: [September 5, 2022, 8:57am UTC](https://discourse.vtk.org/t/how-to-avoid-or-repair-non-manifold-edge-when-using-vtkclipdataset/9279/1 "2022-09-05T08:57:39Z")

</div>

I am using vtkClipDataSet to clip unstructured grid composed of vtkPolyhedron. The first time of clipping is always perfect, but the second time or more sometimes generate warning such as non-manifold edge. How to avoid or repair non-manifold edges?

Here is my code:

```auto
# temp_grid is unstructured grid composed of vtkPolyhedron.
# the origin shape of temp_grid is cube, I want to clip it twice.
# generate_plane is a function to generate vtkPlane.
clipper = vtkClipDataSet()
clipper.SetInputData(temp_grid) 
clipper.SetClipFunction(generate_plane(1)) 
clipper.InsideOutOn()
clipper.Update()
temp_grid: vtkUnstructuredGrid = clipper.GetOutput()

clipper = vtkClipDataSet()
clipper.SetInputData(temp_grid)
clipper.SetClipFunction(generate_plane(2))
clipper.InsideOutOn()
clipper.Update()
temp_grid: vtkUnstructuredGrid = clipper.GetOutput()

```

Here is the output in console:

```auto
2022-09-05 16:22:19.223 ( 0.057s) [935C43] vtkPolyhedron.cxx:1373 WARN| The polyhedron is not watertight or non-manifold because the number of faces of edge 87-88 is not 2 but 1
2022-09-05 16:22:19.223 ( 0.057s) [935C43] vtkPolyhedron.cxx:1373 WARN| The polyhedron is not watertight or non-manifold because the number of faces of edge 86-87 is not 2 but 1
2022-09-05 16:22:19.223 ( 0.057s) [935C43] vtkPolyhedron.cxx:1373 WARN| The polyhedron is not watertight or non-manifold because the number of faces of edge 90-89 is not 2 but 1
2022-09-05 16:22:19.223 ( 0.057s) [935C43] vtkPolyhedron.cxx:1373 WARN| The polyhedron is not watertight or non-manifold because the number of faces of edge 89-86 is not 2 but 1
.........

```

Thanks for your help.
