dca6671DistMesh examples: interactive numbl companionJeremy Magland 1% ex10_ellipsoid.m — Uniform mesh on an ellipsoid.
2%
3% An approximate distance function for the ellipsoid with semi-axes
4% 2, 1, 1.5. As in the 2-D ellipse, the projection step keeps boundary
5% nodes on the true surface despite the approximation.
7mip load --install distmesh
9fd=@(p) p(:,1).^2/4+p(:,2).^2/1+p(:,3).^2/1.5^2-1;
10[p,t]=distmeshsurface(fd,@huniform,0.2,[-2.1,-1.1,-1.6; 2.1,1.1,1.6]);
12title('Ellipsoid');
13fprintf('mesh: %d nodes, %d triangles\n', size(p,1), size(t,1));