Twist in Grasshopper

Example-twist (2).gh (16.1 KB)

Hi, using the Twist command I want to create a box twisted like the picture attatched.
the question is,
is there a way to make the twisting box thinner in the middle and going back to the normal size at the ends?

If you rotate a series of squares around your axis you can scale them according to a sine wave using graph mapper to get your tapering effect. Loft the squares to get your twisted box.