0001
0002
0003
0004
0005 dt=pi/40;
0006 t=0:dt:2*pi-dt;
0007
0008
0009 h=100;
0010 r1=20;
0011 r2=25;
0012 a=-1;
0013 b=0;
0014 c=1;
0015 d=-h;
0016
0017
0018
0019 n1=[r1*sin(t(:)) r1*cos(t(:)) zeros(size(t(:)))];
0020 n2=[r2*sin(t(:)) r2*cos(t(:)) zeros(size(t(:)))];
0021
0022 n3=[r1*sin(t(:)) r1*cos(t(:)) -d-(a*r1*sin(t(:))+b*r1*cos(t(:)))/c];
0023 n4=[r2*sin(t(:)) r2*cos(t(:)) -d-(a*r2*sin(t(:))+b*r2*cos(t(:)))/c];
0024
0025 no=[n1;n2;n3;n4];
0026
0027
0028
0029 clear fc;
0030 count=1;
0031 for i=1:length(t)-1
0032
0033 fc{count}={[i+length(t) i+3*length(t) i+3*length(t)+1 i+length(t)+1],1}; count=count+1;
0034 fc{count}={[i i+2*length(t) i+2*length(t)+1 i+1],2}; count=count+1;
0035 end
0036 i=length(t);
0037 fc{count}={[i+length(t) i+3*length(t) 1+3*length(t) 1+length(t)],1}; count=count+1;
0038 fc{count}={[i i+2*length(t) 1+2*length(t) 1],2}; count=count+1;
0039
0040 fc{count}={1:1+length(t)-1,3};count=count+1;
0041 fc{count}={[1+length(t):1+length(t)*2-1 nan fliplr(1:1+length(t)-1)],4};count=count+1;
0042 fc{count}={1+length(t)*2:1+length(t)*3-1,5};count=count+1;
0043 fc{count}={[1+length(t)*3:1+length(t)*4-1 nan fliplr(1+length(t)*2:1+length(t)*3-1)],6};
0044
0045
0046
0047 [node,elem,face]=surf2mesh(no,fc,min(no),max(no),1,50,[0 0 1],[],0);
0048
0049 plotmesh(no,fc,'y>-0.1');
0050 figure
0051 plotmesh(node,elem,'x>0 | y>0');