# Clipping an stl with a cylinder

**URL:** https://discourse.vtk.org/t/clipping-an-stl-with-a-cylinder/2012
**Category:** Support
**Created:** [October 31, 2019, 9:03am UTC](https://discourse.vtk.org/t/clipping-an-stl-with-a-cylinder/2012 "2019-10-31T09:03:24Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 31, 2019, 5:41pm UTC](https://discourse.vtk.org/t/clipping-an-stl-with-a-cylinder/2012/5 "2019-10-31T17:41:34Z")

</div>

If you want to clip all the way through your polydata with a cylinder, then the fastest way is to use [vtkClipPolyData](https://vtk.org/doc/nightly/html/classvtkClipPolyData.html) with [vtkCylinder](https://vtk.org/doc/nightly/html/classvtkCylinder.html). The vtkCylinder defines an implicit function for the cylinder, instead of defining the cylinder with polygons. Clipping polydata with a function is hundreds of times faster than clipping polydata with another polydata.

For example, see [this example](https://lorensen.github.io/VTKExamples/site/Cxx/VisualizationAlgorithms/ClipSphereCylinder/) (unfortunately, it’s not a good example, since the example is much more complicated than what you need).

Edit: Note that if you use vtkImplicitDataSet to create the implicit function, you lose all of the speed benefits of implicit functions. The fast implicit functions are the simple ones: vtkPlane, vtkCylinder, vtkSphere and vtkImplicitVolume.

---

_[View the full topic](https://discourse.vtk.org/t/clipping-an-stl-with-a-cylinder/2012)._
