concept-collection / numbl-distmesh
numbl-distmesh / ex11_unit_ball.m
11 lines · 442 BBlameHistoryRaw
1% ex11_unit_ball.m — Uniform tetrahedral mesh of the 3-D unit ball (distmeshnd).
2%
3% distmeshnd is the general N-D mesh generator; here it fills the solid unit
4% ball (signed distance sqrt(sum(p.^2,2))-1) with a uniform mesh at edge
5% length 0.2. The plot shows a cut-away (p(:,2)>0) of the tetrahedra.
7mip load --install distmesh
9disp('3-D Unit ball')
10fd=@(p) sqrt(sum(p.^2,2))-1;
11[p,t]=distmeshnd(fd,@huniform,0.2,[-1,-1,-1;1,1,1],[]);