Need help with twist geometry

Hi,

I’m trying to create a script for this model where the twist could be controlled with a graph mapper and the location could be controlled with a domain range. So far I’m able to create the polysurface in rhino manually and then create the extruded contours in grasshopper.

If anyone has resources I can follow and learn, I would gladly appreciate it.