Perhaps, you could use implicit functions instead, two vtkCylinder and two vtkPlane. Here I used two vtkCylinder and 4 vtkSphere