# Arc in Polydata

**URL:** https://discourse.vtk.org/t/arc-in-polydata/7242
**Category:** Support
**Created:** [November 22, 2021, 10:35am UTC](https://discourse.vtk.org/t/arc-in-polydata/7242 "2021-11-22T10:35:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![devngc](https://discourse.vtk.org/user_avatar/discourse.vtk.org/devngc/32/2750_2.png) [@devngc](https://discourse.vtk.org/u/devngc)
#### Post date: [November 22, 2021, 10:35am UTC](https://discourse.vtk.org/t/arc-in-polydata/7242/1 "2021-11-22T10:35:49Z")

</div>

I am using the following code to add an Arc to the Polydata. Please correct me if I am wrong but I can’t get arcs in Polydata. It will still be a line.

```python

center = [0.00, 25.72, 30.99]
p1 = [77.65, 63.01, 0.04]
p2 = [77.58, 63.01, 0.04]

arc = vtk.vtkArcSource()
arc.SetCenter(center[0], center[1], center[2])
arc.SetPoint1(p1[0], p1[1], p1[2])
arc.SetPoint2(p2[0], p2[1], p2[2])
arc.Update()

polydata = vtk.vtkPolyData()
polydata.ShallowCopy(arc.GetOutput())
polydata.Modified()

# write an XML file
writer = vtk.vtkXMLPolyDataWriter()
writer.SetFileName('arc.vtp')
writer.SetInputData(polydata)
writer.Write()

```

---

<div class="post-metadata">

### Author: ![devngc](https://discourse.vtk.org/user_avatar/discourse.vtk.org/devngc/32/2750_2.png) [@devngc](https://discourse.vtk.org/u/devngc)
#### Post date: [November 24, 2021, 5:41am UTC](https://discourse.vtk.org/t/arc-in-polydata/7242/2 "2021-11-24T05:41:41Z")

</div>

Hi @lassoan,

Is it possible to have an arc in vtk?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [November 24, 2021, 5:54am UTC](https://discourse.vtk.org/t/arc-in-polydata/7242/3 "2021-11-24T05:54:20Z")

</div>

The code snippet above looks good. Did you expect that the arc source will generate some higher-order element instead of a polyline?

---

<div class="post-metadata">

### Author: ![devngc](https://discourse.vtk.org/user_avatar/discourse.vtk.org/devngc/32/2750_2.png) [@devngc](https://discourse.vtk.org/u/devngc)
#### Post date: [November 29, 2021, 6:47am UTC](https://discourse.vtk.org/t/arc-in-polydata/7242/4 "2021-11-29T06:47:56Z")

</div>

Yes. I expect it to generate an actual arc. Is that not possible in vtk?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [November 29, 2021, 1:31pm UTC](https://discourse.vtk.org/t/arc-in-polydata/7242/5 "2021-11-29T13:31:59Z")

</div>

An arc is represented by the `vtkArcSource` class in VTK. The class uses a parametric representation internally and for the rest of the processing and visualization pipeline it provides a polygonal representation at arbitrarily high resolution .

You must use a polygonal representation, because most general geometry processing algorithms and graphics hardware only supports basic linear primitives, such as points, lines, convex polygons (see for example [Primitive - OpenGL Wiki](https://www.khronos.org/opengl/wiki/Primitive) and [Chapter 11 - OpenGL Programming Guide](http://www.glprogramming.com/red/chapter11.html)).
