density=2;
maxvol=10;
%% creating a simple brick-shaped mesh

corner1=[0 0 0];
corner2=[40,30,20]
[nbox,fbox,ebox]=meshabox(corner1,corner2,density,maxvol);

plotmesh(nbox,ebox);


%% creating a simple spherical mesh
c0=[10 11 15];
radius=20;
[nsph,fsph,esph]=meshasphere(c0,radius,density,maxvol);
figure;
plotmesh(nsph,esph);


%% creating a simple brick-shaped mesh

% mesh a 2-layer structure using a simple lattice
[node,face,c0]=latticegrid([0 10],[0 5],[0 3 4]);
figure; plotmesh(node,face)

c0(:,4)=[0.01;0.003]; %the 4th element of the seed defines the density (max-volume)
[no,el]=surf2mesh(node,face,[],[],1,[],c0);
figure; plotmesh(no,el)
