mesh-donut↔mug

Morphing a mesh from a donut to a coffee mug -- a visualization of the topologist's joke.
Compared to my other, SDF-based approach, this is an onerous one:
The 2D/3D coordinates of each vertex on the mesh is semi-programatically generated, then subdivided.
See lower-right for the base 2D mesh that both the donut and the mug map to.
There's gotta be a better way... but hey it works!