Finally got around to trying this out. It works…mostly. There is still one twist near the apex (see attached image). I haven’t delved into the code to figure out why. A promising result, though.
BTW – two corrections to your code: there are two ‘next i’ nestings, and the ‘n’ in the first TUBE command doesn’t work (I replaced with NSP/4).
AC20 6005 AUS Full & AC 21 3009 NZE Full | Win 10 Pro 64 | Intel i7-7700HQ 2.80GHz | 16 Gb RAM
NVIDIA GeForce GTX 1060 8Mb