# CropPolyData for a new "Surface Patch Selection Widget"

**URL:** <https://discourse.vtk.org/t/croppolydata-for-a-new-surface-patch-selection-widget/10879>\
**Category:** Development\
**Tags:** code\
**Created:** [March 4, 2023, 1:30pm UTC](https://discourse.vtk.org/t/croppolydata-for-a-new-surface-patch-selection-widget/10879 "2023-03-04T13:30:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)\
**Post date:** [March 4, 2023, 1:30pm UTC](https://discourse.vtk.org/t/croppolydata-for-a-new-surface-patch-selection-widget/10879/1 "2023-03-04T13:30:22Z")

</div>

Hi Developers

I am trying to create a widget similar to the `vtkContourWidget` for selecting `vtkPolyData` along a contour. For this, I created a new implicit function for clipping, `vtkCapsule`

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/4d6cec246416ed28c1a2b1870bae9859f5676893.png)

When updating the contour, I use `vtkExtractPolyData` using implicit functions for each line segment. My current approach is maintain an instance of `vtkPolyData` that is updated using `vtkAppendPolyData` and every now and then I remove duplicate cells using a `vtkCleanPolyData`.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8d16edd780b499fd60759dd02957dafb7efc0c6c.png)

It doesn’t scale very well for large meshes. Is it somehow possible to reduce the `UPDATE_EXTENT` such that the implicit functions only are applied on a subset of the large mesh. I am thinking of a filter that I can squeeze in between my source for `vtkPolyData` and `vtkExtractPolyData`. I am thinking about a "vtkPolyDataCropFilter`. I tried setting `UPDATE\_EXTENT`on the output information, but that just get updated to`WHOLE\_EXTENT` when executing the pipeline.

It is probably just me not knowing the name of the correct filter.

Thanks in advance  
Jens Munk
