Extrusion of polygon along line

Hello all,

I’m quite new to vtk and I’m asking for help with extrusion. In particular, I would like to extrude a polygon along a line in the space (most probably a spline). I think this is possible because I saw this query: [vtkusers] Extrude a 3D object along 3D path ?, but since I’m new it’s very hard for me to follow their discussion. Could someone help me?

Please note that I have already the polygon, and it is in the form of

vtk.vtkPolyData

What a normal extrusion would look like, is the following:

extrudeFilter = vtk.vtkLinearExtrusionFilter()
extrudeFilter.SetInputData(polygonPolyData)
extrudeFilter.SetExtrusionTypeToNormalExtrusion()
#extrudeFilter.SetVector(0.0, 0.0, 1.0)  # Extrude along the z-axis
extrudeFilter.SetScaleFactor(10.0)  # Set the extrusion length
extrudeFilter.Update()

Instead of extruding the polygon along the z-axis, I would like to follow a curve in the space.

Thank you for your help.

Hi, this tutorial will be useful for you https://examples.vtk.org/site/Cxx/Visualization/ExtrudePolyDataAlongLine/