# Is it possible to set thickness for vtkPolygon

**URL:** https://discourse.vtk.org/t/is-it-possible-to-set-thickness-for-vtkpolygon/7866
**Category:** Support
**Created:** [February 18, 2022, 3:47am UTC](https://discourse.vtk.org/t/is-it-possible-to-set-thickness-for-vtkpolygon/7866 "2022-02-18T03:47:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 18, 2022, 3:47am UTC](https://discourse.vtk.org/t/is-it-possible-to-set-thickness-for-vtkpolygon/7866/1 "2022-02-18T03:47:12Z")

</div>

I want to use `vtkPolygon` in my project, and the code is pasted as following:

```auto
import vtkmodules.all as vtk

polyData = vtk.vtkPolyData()

vps = vtk.vtkPoints()
polygon = vtk.vtkPolygon()

polygon.GetPointIds().SetNumberOfIds(3)

vps.InsertNextPoint(0, 0, 0)
polygon.GetPointIds().SetId(0, 0)
vps.InsertNextPoint(1, 0, 0)
polygon.GetPointIds().SetId(1, 1)
vps.InsertNextPoint(0, 1, 0)
polygon.GetPointIds().SetId(2, 2)
polygons = vtk.vtkCellArray()
polygons.InsertNextCell(polygon)
polyData.SetPoints(vps)
polyData.SetPolys(polygons)

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(polyData)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
render = vtk.vtkRenderer()
render.AddActor(actor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(render)
iren = vtk.vtkRenderWindowInteractor()
iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start()

```

I can correctly show this polygon:

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

However, when I rotate this polygon, if the normal of this polygon is parallel to the view up direction of vtkCamera, the polygon will disappear. Like:

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

I wonder whether it is possible to set a thickness to the vtkPolygon. So that the polygon will look like a line when the normal of polygon is parallel to the view up direction of vtkCamera.

In a word, I don’t want this polygon disappear.

Any suggestion is appreciated~~

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [February 18, 2022, 11:13am UTC](https://discourse.vtk.org/t/is-it-possible-to-set-thickness-for-vtkpolygon/7866/2 "2022-02-18T11:13:22Z")

</div>

You can perform a modeling operation like vtkLinearExtrusionFilter to transform the 2D polygon into a 3D wedge. Extrude in the direction of the polygon normal.
