Creating 3D objects and slice them to obtain 2D numpy array

Thank you Giannis, this looks like what I want. However, I think that with vtkPolyData I do not have volumes, but just points in the space. I have tried to convert my PolyData to ImageData, but without success. For example, I have tried to convert a TubeFilter in ImageData using ImageStencil, but what I have as output is just a rectangular shape and not a tube.
The alternative would be of course trying to do the tube shapes with ImageData directly, rather than converting from PolyData, but I am not finding so many examples to follow. Maybe you know some more documentation that I don’t? Thank you.