您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 冶金工业 > 贝齐尔曲面matlab程序
%贝齐尔曲面matlab程序clearclc%------------参数初始化-----------------b0=[[020],[042],[014];%可自行增减控制定点[230],[252],[244];[420],[442],[414];];ptnum1=10;%u方向取样点数ptnum2=10;%v方向取样点数n1=size(b0,1);n2=size(b0,2)/3;u=1;v=1;%------------初始化结束------------------fort2=0:1/ptnum1:1%v方向采样fort1=0:1/ptnum1:1%u方向采样fori=1:n1forj=1:n2bb0(j,1)=b0(i,3*j-2);bb0(j,2)=b0(i,3*j-1);bb0(j,3)=b0(i,3*j);endn=size(bb0,1)-1;bb0x=bb0(:,1);bb0y=bb0(:,2);bb0z=bb0(:,3);bb1x=bb0x;bb1y=bb0y;bb1z=bb0z;fork=1:nforjj=0:n-kbb1x(jj+1)=(1-t1)*bb0x(jj+1)+t1*bb0x(jj+2);bb1y(jj+1)=(1-t1)*bb0y(jj+1)+t1*bb0y(jj+2);bb1z(jj+1)=(1-t1)*bb0z(jj+1)+t1*bb0z(jj+2);endbb0x=bb1x;bb0y=bb1y;bb0z=bb1z;endcc0(i,1)=bb1x(1);cc0(i,2)=bb1y(1);cc0(i,3)=bb1z(1);endn=size(cc0,1)-1;cc0x=cc0(:,1);cc0y=cc0(:,2);cc0z=cc0(:,3);cc1x=cc0x;cc1y=cc0y;cc1z=cc0z;fork=1:nforjj=0:n-kcc1x(jj+1)=(1-t2)*cc0x(jj+1)+t2*cc0x(jj+2);cc1y(jj+1)=(1-t2)*cc0y(jj+1)+t2*cc0y(jj+2);cc1z(jj+1)=(1-t2)*cc0z(jj+1)+t2*cc0z(jj+2);endcc0x=cc1x;cc0y=cc1y;cc0z=cc1z;endptx(u,v)=cc1x(1);pty(u,v)=cc1y(1);ptz(u,v)=cc1z(1);u=u+1;endu=1;v=v+1;endmesh(ptx,pty,ptz)
本文标题:贝齐尔曲面matlab程序
链接地址:https://www.777doc.com/doc-5410040 .html