# Convert 2d polydata data(2d mesh) to 3d mesh with cell data

**URL:** https://discourse.vtk.org/t/convert-2d-polydata-data-2d-mesh-to-3d-mesh-with-cell-data/9645
**Category:** Development
**Created:** [October 19, 2022, 4:25am UTC](https://discourse.vtk.org/t/convert-2d-polydata-data-2d-mesh-to-3d-mesh-with-cell-data/9645 "2022-10-19T04:25:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lizemin2016](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lizemin2016/32/5266_2.png) [@lizemin2016](https://discourse.vtk.org/u/lizemin2016)
#### Post date: [October 19, 2022, 4:25am UTC](https://discourse.vtk.org/t/convert-2d-polydata-data-2d-mesh-to-3d-mesh-with-cell-data/9645/1 "2022-10-19T04:25:53Z")

</div>

I have a polydata created by points(with z-value 0) and polys, and cell attribute data, How can I convert this 2d polydata data(2d mesh) to 3d mesh use the scalar attribute data. I hope you can give me some suggestions and methods, I look forward to your reply!

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.vtk.org/user_avatar/discourse.vtk.org/spyridon97/32/7069_2.png) [@spyridon97](https://discourse.vtk.org/u/spyridon97)
#### Post date: [October 19, 2022, 9:47pm UTC](https://discourse.vtk.org/t/convert-2d-polydata-data-2d-mesh-to-3d-mesh-with-cell-data/9645/2 "2022-10-19T21:47:47Z")

</div>

So, you want to set the z dimensions by using one of your cell data?  
If that’s correct, then you need to use vtkCellDataToPointData to create point data out of your cell data  
and then either use [vtkWarpScalar](https://vtk.org/doc/nightly/html/classvtkWarpScalar.html) (read the documentation) or just change the z array using your scalar point data array.

---

<div class="post-metadata">

### Author: ![lizemin2016](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lizemin2016/32/5266_2.png) [@lizemin2016](https://discourse.vtk.org/u/lizemin2016)
#### Post date: [October 20, 2022, 3:08am UTC](https://discourse.vtk.org/t/convert-2d-polydata-data-2d-mesh-to-3d-mesh-with-cell-data/9645/3 "2022-10-20T03:08:23Z")

</div>

Thank you my friend! this is exactly what I need.
