dca6671DistMesh examples: interactive numbl companionJeremy Magland 1% ex07_sphere.m — Uniform mesh on the unit sphere.
2%
3% distmeshsurface meshes the zero level set of a 3-D distance function.
4% dsphere(p,xc,yc,zc,r) is the signed distance to a sphere; here the unit
5% sphere centered at the origin. Drag to rotate the result.
7mip load --install distmesh
9fd=@(p) dsphere(p,0,0,0,1);
10[p,t]=distmeshsurface(fd,@huniform,0.2,1.1*[-1,-1,-1;1,1,1]);
12title('Unit sphere');
13fprintf('mesh: %d nodes, %d triangles\n', size(p,1), size(t,1));