# Request for Guidance: Cleaning STL PolyData and Preparing for Smooth Extrusion in VTK

**URL:** https://discourse.vtk.org/t/request-for-guidance-cleaning-stl-polydata-and-preparing-for-smooth-extrusion-in-vtk/16113
**Category:** Support
**Tags:** code
**Created:** [October 28, 2025, 10:00am UTC](https://discourse.vtk.org/t/request-for-guidance-cleaning-stl-polydata-and-preparing-for-smooth-extrusion-in-vtk/16113 "2025-10-28T10:00:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![christeen](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@christeen](https://discourse.vtk.org/u/christeen)
#### Post date: [October 28, 2025, 10:00am UTC](https://discourse.vtk.org/t/request-for-guidance-cleaning-stl-polydata-and-preparing-for-smooth-extrusion-in-vtk/16113/1 "2025-10-28T10:00:40Z")

</div>

Dear VTK Developers,

I hope you’re doing well.

I’m currently working on loading STL files into VTK and performing extrusion operations based on selected surface regions. Specifically, I select a region by **drawing a contour circle** and considering only the **inner region** of that contour for extrusion.

To ensure the extrusion does not start directly from the STL surface, I offset the selected region by **0.1 units along the surface normal** , so that the extrusion is generated **slightly above** the STL model rather than from within it.

However, the extrusion process becomes problematic. I believe that STL models contain **impurities** , such as:

- Self-intersecting triangles
- Non-manifold edges or vertices
- Tiny disconnected loops or holes
- Duplicate or degenerate faces
- Gaps or inconsistent triangle orientations

These issues may cause instability and artifacts during surface processing — especially when using filters like `vtkLinearExtrusionFilter` or when computing per-vertex normals for smooth extrusion.

I’ve attached reference images that illustrate the problem.

 ![FrontView](https://discourse.vtk.org/uploads/default/original/2X/0/078b3bf4622c7aa3347115511f6feb9133157cf8.jpeg)  
 ![BottomView](https://discourse.vtk.org/uploads/default/original/2X/c/cacd1c46af96dae966271d2dbb97ab6e7c8e82fe.jpeg)

I already tried with vtkCleanPolyData after the loading of STL and provided for the following operations.

Any guidance or suggestions on how to **clean** , **repair** , or **prepare** such STL `vtkPolyData` (or offsetting of surface) for stable extrusion would be greatly appreciated.

@lassoan @dgobbi @LucasGandel @mwestphal @ben.boeckel @pieper

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [October 28, 2025, 10:03am UTC](https://discourse.vtk.org/t/request-for-guidance-cleaning-stl-polydata-and-preparing-for-smooth-extrusion-in-vtk/16113/2 "2025-10-28T10:03:48Z")

</div>

Look into TTK and Vespa for such operations:  
[https://www.kitware.com/inspect-and-repair-your-meshes-in-paraview/](https://www.kitware.com/inspect-and-repair-your-meshes-in-paraview/)
