How can I deform 3D Mask? (Flare out, Taper in)

Wouldn’t it be possible to use some kind of gradient to change the diameter of a cylinder along the height?