0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 hw=imread('helloworld.png');
0011
0012
0013
0014 hw3d=1-repmat(hw,[1 1 50]);
0015
0016
0017 [node,elem,face]=v2m(hw3d,0.7,5,40);
0018
0019
0020
0021 figure;
0022 subplot(211);
0023 plotmesh(node,face);axis equal;view(90,60);
0024 subplot(212);
0025 plotmesh(node,elem,'z<20');axis equal;view(90,60);
0026
0027
0028 [node,elem,face]=v2m(hw3d,0.7,2,40);
0029
0030 figure;
0031 subplot(211);
0032 plotmesh(node,face);axis equal;view(90,60);
0033 subplot(212);
0034 plotmesh(node,elem,'z<20');axis equal;view(90,60);
0035
0036
0037 hw=imread('helloworld_gray.png');
0038 hw3d=255-repmat(hw,[1 1 50]);
0039 [node,elem,face]=v2m(hw3d,128,2,40);
0040
0041 figure;
0042 subplot(211);
0043 plotmesh(node,face);axis equal;view(90,60);
0044 subplot(212);
0045 plotmesh(node,elem,'z<20');axis equal;view(90,60);
0046
0047
0048 clear opt
0049 opt.radbound=4;
0050 opt.distbound=0.2;
0051 opt.autoregion=1;
0052 [node,elem,face]=v2m(hw3d,128,opt,40);
0053
0054 figure;
0055 subplot(211);
0056 plotmesh(node,face);axis equal;view(90,60);
0057 subplot(212);
0058 plotmesh(node,elem,'z<20');axis equal;view(90,60);
0059