This implementation is based on Peter Henderson's paper "Functional Geometry". See here. I use the fish vertices with some changes from here.