- function ysw
- clc;clear all;close all
- x=[0.4,0.4,0.4,0.4,0.4,...
- 0.5,0.5,0.5,0.5,0.5,...
- 0.6,0.6,0.6,0.6,0.6];
- y=[0.15,0.2,0.28,0.35,0.4,...
- 0.15,0.2,0.28,0.35,0.4,...
- 0.15,0.2,0.28,0.35,0.4,];
- z1=[566,566,566,907,1351,...
- 472,472,472,907,1351,...
- 377,377,377,907,1351];
- z2=[810,810,810,2000,3000,...
- 675,675,675,2000,3000,...
- 540,540,540,2000,3000];
- sf1=fit([x',y'],z1','poly23');
- sf2=fit([x',y'],z2','poly23');
- xx = min(x):0.01:max(x);
- yy = min(y):0.01:max(y);
- [xx,yy] = meshgrid(xx,yy);
- zz1 = sf1(xx,yy);
- zz2 = sf2(xx,yy);
- % figure(1),hold on;
- % plot3(xx,yy,zz1,'ro');
- % plot3(xx,yy,zz2,'go');
- % hold off
- p(:,1) = [xx(:);xx(:)]/2;
- p(:,2) = [yy(:);yy(:)]/2;
- p(:,3) = [zz1(:);zz2(:)]/5000000;
- [t]=MyCrust(p);
- % plot3(p(:,1),p(:,2),p(:,3),'g.')
- %% plot of the oyput triangulation
- figure(2)
- hold on
- % axis equal
- % trisurf(t,p(:,1),p(:,2),p(:,3),'facecolor','c','edgecolor','b')%plot della superficie trattata
- trisurf(t,p(:,1)*2,p(:,2)*2,p(:,3)*5000000,'edgecolor','b')
- view(-37.5,30);
- % axis tight;
复制代码
具体的代码下载链接:
|