# 2D mesh to 3D prismatic by extrusion along z-axis

**URL:** https://discourse.paraview.org/t/2d-mesh-to-3d-prismatic-by-extrusion-along-z-axis/10154
**Category:** ParaView Support
**Tags:** vtk
**Created:** [August 16, 2022, 2:39pm UTC](https://discourse.paraview.org/t/2d-mesh-to-3d-prismatic-by-extrusion-along-z-axis/10154 "2022-08-16T14:39:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![denis-anuprienko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/denis-anuprienko/32/9755_2.png) [@denis-anuprienko](https://discourse.paraview.org/u/denis-anuprienko)
#### Post date: [August 16, 2022, 2:39pm UTC](https://discourse.paraview.org/t/2d-mesh-to-3d-prismatic-by-extrusion-along-z-axis/10154/1 "2022-08-16T14:39:28Z")

</div>

Hello!  
I have a .vtk file with a polygonal mesh in a square domain. I would like to create a 3D prismatic mesh by extruding the 2D mesh along vertical axis. Is there an option to do that? It seems that Linear Extrusion filter is not what I’m looking for.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [August 18, 2022, 4:16am UTC](https://discourse.paraview.org/t/2d-mesh-to-3d-prismatic-by-extrusion-along-z-axis/10154/2 "2022-08-18T04:16:22Z")

</div>

Hello,

The **Linear Cell Extrusion** filter would be able to extrude triangles into prism elements. However, this filter requires that the data be Cell data.

If this filter is not available, you will need to write an extrusion script with a **Programmable Filter**. The following may be helpful in this case.

> [@Adding thickness to a surface mesh](https://discourse.paraview.org/t/adding-thickness-to-a-surface-mesh/6568):
>
> I have a spherical surface with a scalar field on it, as shown here in 3d and in a cross section: I would like to give the surface a thickness, so that it looks more like this (surface has thickness and there should be no artifacts in the cross section): [target] What has not worked so far is: Change line width: Under Styling \> Line Width. This has no effect on the 3d view. It only changes the width of the line in the cross section. However, the larger line thickness l…

---

<div class="post-metadata">

### Author: ![denis-anuprienko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/denis-anuprienko/32/9755_2.png) [@denis-anuprienko](https://discourse.paraview.org/u/denis-anuprienko)
#### Post date: [October 5, 2022, 4:34pm UTC](https://discourse.paraview.org/t/2d-mesh-to-3d-prismatic-by-extrusion-along-z-axis/10154/3 "2022-10-05T16:34:41Z")

</div>

Dear Kenichiro,

thank you for the advice.

To anyone interested, I actually made a piece of code that creates 3D extrusion from a 2D mesh of general polygons. It works fine with meshes created by [PolyMesher](https://link.springer.com/article/10.1007/s00158-011-0706-z), which was my main aim. Please find attached the code (it may be a bit messy).

As for vertical refinement, you have to apply Transform filter several times, translating the 3D extruded mesh to create several layers and then unite them using AppendDatasets filter.  
[extrude\_poly.py](https://discourse.paraview.org/uploads/short-url/J0GdpeHCqW0BXDAq8VgYNhiPz1.py) (2.4 KB)

Sincerely,  
Denis
