# about polygon

**URL:** https://discourse.vtk.org/t/about-polygon/6149
**Category:** Support
**Created:** [July 8, 2021, 7:47am UTC](https://discourse.vtk.org/t/about-polygon/6149 "2021-07-08T07:47:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Hurmean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hurmean/32/2964_2.png) [@Hurmean](https://discourse.vtk.org/u/Hurmean)
#### Post date: [July 8, 2021, 7:47am UTC](https://discourse.vtk.org/t/about-polygon/6149/1 "2021-07-08T07:47:45Z")

</div>

code as follows:  
vtkSmartPointer pts = vtkSmartPointer::New();  
vtkSmartPointer cs = vtkSmartPointer::New();  
pts-\>SetNumberOfPoints(4);

```
pts->InsertPoint(2, 100, 200, 0);
pts->InsertPoint(3, 50, 50, 0);
pts->InsertPoint(0, 100, 150, 0);
pts->InsertPoint(1, 200, 50, 0);

vtkSmartPointer<vtkPolygon> plg = vtkSmartPointer<vtkPolygon>::New();
plg->GetPointIds()->SetNumberOfIds(4);
plg->GetPointIds()->SetId(0, 2);
plg->GetPointIds()->SetId(1, 3);
plg->GetPointIds()->SetId(2, 0);
plg->GetPointIds()->SetId(3, 1);
cs->InsertNextCell(plg);
   when i change the vtkPolygon as follows：	
   vtkSmartPointer<vtkPolygon> plg = vtkSmartPointer<vtkPolygon>::New();
plg->GetPointIds()->SetNumberOfIds(4);
plg->GetPointIds()->SetId(0, 1);
plg->GetPointIds()->SetId(1, 2);
plg->GetPointIds()->SetId(2, 3);
plg->GetPointIds()->SetId(3, 0);
    there as different resluts

```

![3](https://discourse.vtk.org/uploads/default/original/2X/f/f527559b27bc74e3c5d34af46e937ffff11aaa2b.png)  
 ![4](https://discourse.vtk.org/uploads/default/original/2X/9/9318e9473da477b5d31c36265c061ed3d28eeec8.png)
