% mesh_torus.m — A torus (genus-1 surface). % % surfacemesh.torus(p+1, nu, nv) builds a smooth torus with nu patches % around the tube and nv patches around the ring. Surfaces of any genus % are supported. mip load --install flatironinstitute/flatironinstitute/surfacefun p = 16; nu = 8; nv = 24; dom = surfacemesh.torus(p + 1, nu, nv); figure(1); plot(dom), camlight title('Torus'); fprintf('patches: %d\n', length(dom));