The applet below plots the curve |d0+d1u1+d2u2|=1 on the torus |u1|=|u2|=1. The coordinates are tj where uj=e2&pi i tj, so that the torus is represented as a square [-0.5,0.5]x[-0.5,0.5].
The buttons allow to change the parameters di.