# Display subset of polydata

**URL:** https://discourse.vtk.org/t/display-subset-of-polydata/5267
**Category:** Web
**Created:** [February 26, 2021, 9:01pm UTC](https://discourse.vtk.org/t/display-subset-of-polydata/5267 "2021-02-26T21:01:02Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![nelly](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/ed8c4c/32.png) [@nelly](https://discourse.vtk.org/u/nelly)
#### Post date: [March 5, 2021, 1:19am UTC](https://discourse.vtk.org/t/display-subset-of-polydata/5267/9 "2021-03-05T01:19:45Z")

</div>

I was able to achieve what I wanted. Here are the steps I took to display a subset of polygons. I first grabbed the cell data and indices of cell data above my threshold. I then created new polydata instance, and grabbed the appropriate polys and points using the thresholded indices. Then I set the new polydata instance with those newly created data arrays. I found these helpful:

[https://public.kitware.com/pipermail/vtkusers/2004-July/025395.html](https://public.kitware.com/pipermail/vtkusers/2004-July/025395.html)

> [@Manually Create PolyData in vtk.js](https://discourse.vtk.org/t/manually-create-polydata-in-vtk-js/885):
>
> I am struggling to create polydata manually with vtk.js. The methods I used in VTK are not working/supported in vtk.js. A basic example from VTK is as follows: vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer triangles = vtkSmartPointer::New(); vtkSmartPointer textureCoordinates = vtkSmartPointer::New(); textureCoordinates-\>SetNumberOfComponents(2); textureCoordinates-\>SetName(“TextureCoordinates”); float xval, yval, x1, y1, x2, y2; double sinangtop = Math::Sin(vtkMath::R…

---

_[View the full topic](https://discourse.vtk.org/t/display-subset-of-polydata/5267)._
