# Smooth surface boundary

**URL:** https://discourse.vtk.org/t/smooth-surface-boundary/5826
**Category:** Support
**Created:** [May 20, 2021, 8:32am UTC](https://discourse.vtk.org/t/smooth-surface-boundary/5826 "2021-05-20T08:32:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Beheshtian](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Beheshtian](https://discourse.vtk.org/u/Beheshtian)
#### Post date: [May 20, 2021, 8:32am UTC](https://discourse.vtk.org/t/smooth-surface-boundary/5826/1 "2021-05-20T08:32:21Z")

</div>

Hi all,  
I have a surface with a bad boundary.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/49c483b8a86b6c3ddcae3d205e33ea4b61003e8a.png)  
I need to smooth and repair the boundary. I used vtkSmoothPolydata but not useful.

```
smoothFilter = vtk.vtkSmoothPolyDataFilter()
smoothFilter.SetInputData(part)
smoothFilter.SetNumberOfIterations(iterate)
smoothFilter.SetRelaxationFactor(relaxationFactor)
smoothFilter.BoundarySmoothingOn()
smoothFilter.Update()

```

I’ll be pleased if anyone knows the solution.  
best regards.

---

<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 20, 2021, 11:14am UTC](https://discourse.vtk.org/t/smooth-surface-boundary/5826/2 "2021-05-20T11:14:22Z")

</div>

Also try windowed sinc polydata filter. It’s a better smoothing method.

---

<div class="post-metadata">

### Author: ![Beheshtian](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Beheshtian](https://discourse.vtk.org/u/Beheshtian)
#### Post date: [May 20, 2021, 11:26am UTC](https://discourse.vtk.org/t/smooth-surface-boundary/5826/3 "2021-05-20T11:26:50Z")

</div>

Hi Will,  
Thank you for your reply.  
I used [vtkWindowedSincPolyDataFilter](https://vtk.org/doc/nightly/html/classvtkWindowedSincPolyDataFilter.html) and [SetEdgeAngle](https://vtk.org/doc/nightly/html/classvtkWindowedSincPolyDataFilter.html#a3d29894c76bf3c6415e3c372e1e172cf). it was perfect. Thanks.

```
windowed = vtk.vtkWindowedSincPolyDataFilter()
windowed.SetInputData(part)
windowed.SetNumberOfIterations(20)
windowed.FeatureEdgeSmoothingOn()
windowed.SetFeatureAngle(180)
windowed.BoundarySmoothingOn()
windowed.SetEdgeAngle(180)
windowed.Update()
```
