# Extrude output of delaunay 2D

**URL:** https://discourse.vtk.org/t/extrude-output-of-delaunay-2d/1751
**Category:** Support
**Created:** [September 12, 2019, 3:16am UTC](https://discourse.vtk.org/t/extrude-output-of-delaunay-2d/1751 "2019-09-12T03:16:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Neilesh\_Vinjamuri](https://discourse.vtk.org/user_avatar/discourse.vtk.org/neilesh_vinjamuri/32/877_2.png) [@Neilesh\_Vinjamuri](https://discourse.vtk.org/u/Neilesh_Vinjamuri)
#### Post date: [September 12, 2019, 3:16am UTC](https://discourse.vtk.org/t/extrude-output-of-delaunay-2d/1751/1 "2019-09-12T03:16:41Z")

</div>

Hi,

I wanted to know whether it is possible to extrude the output from vtkDelaunay2D. I am trying to create a solid whose cross section is a semi-ellipse. I first created a polyData containing an arc attached to a line but when I extrude this I don’t get the faces of the cylinder. So I filled in my polyData with a Delaunay2D but when I try to extrude the GetOutput of this algorithm, it says there is nothing to extrude.

Here is my code:

angle = 0  
majorAxis = 90  
minorAxis = 50  
xCenter = 0.0  
yCenter = 0.0  
maxAngle = 180.0

points = vtk.vtkPoints()  
idx = 0  
while angle \<= 2.0 \* vtk.vtkMath.Pi() \* maxAngle / 360.0 + (vtk.vtkMath.Pi() / 100.0):  
points.InsertNextPoint(majorAxis \* math.cos(angle) + centerX,  
minorAxis \* math.sin(angle) + centerY,  
0.0)  
angle = angle + (vtk.vtkMath.Pi() / 60.0)  
idx += 1  
points.InsertNextPoint(r1 + xCenter, yCenter, 0.0)  
idx += 1

line = vtk.vtkPolyLine()  
line.GetPointIds().SetNumberOfIds(idx)  
for i in range(0, idx):  
line.GetPointIds().SetId(i, i)

lines = vtk.vtkCellArray()  
lines.InsertNextCell(line)

polyData = vtk.vtkPolyData()  
polyData.SetPoints(points)  
polyData.SetLines(lines)

delny = vtk.vtkDelaunay2D()  
delny.SetInputData(polyData)  
delny.SetSourceData(polyData)

extruder = vtk.vtkLinearExtrusionFilter()  
extruder.SetInputData(delny.GetOutput())  
extruder.SetVector( 0, 0, 80 )  
extruder.SetExtrusionTypeToNormalExtrusion()  
extruder.Update()

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [September 13, 2019, 3:23am UTC](https://discourse.vtk.org/t/extrude-output-of-delaunay-2d/1751/2 "2019-09-13T03:23:24Z")

</div>

You might like to try this alternative method: [Capped Sphere](https://lorensen.github.io/VTKExamples/site/Python/Modelling/CappedSphere/). You can modify the the equatios to generate a variety of surfaces.

---

<div class="post-metadata">

### Author: ![Neilesh\_Vinjamuri](https://discourse.vtk.org/user_avatar/discourse.vtk.org/neilesh_vinjamuri/32/877_2.png) [@Neilesh\_Vinjamuri](https://discourse.vtk.org/u/Neilesh_Vinjamuri)
#### Post date: [September 13, 2019, 8:43pm UTC](https://discourse.vtk.org/t/extrude-output-of-delaunay-2d/1751/3 "2019-09-13T20:43:38Z")

</div>

Thanks for the suggestion! What is the best way to subtract two volumes from each other, if both volumes are the output of an extrusion filter? I tried to use vtkBooleanOperationPolyDataFilter but it says there are no points to operate on.
