曲面加工幾何學(xué)_第1頁(yè)
曲面加工幾何學(xué)_第2頁(yè)
曲面加工幾何學(xué)_第3頁(yè)
曲面加工幾何學(xué)_第4頁(yè)
曲面加工幾何學(xué)_第5頁(yè)
已閱讀5頁(yè),還剩8頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

大連理工大學(xué)微分幾何作業(yè)學(xué)院:機(jī)械工程學(xué)院姓名:學(xué)號(hào):授課教師:王曉明電子郵箱:完成時(shí)間:2012年6月25日非均勻有理B樣條〔NURBS〕曲線和曲面非均勻有理B樣條曲線〔3階〕NURBS曲線提供了對(duì)標(biāo)準(zhǔn)解析幾何和自由曲線、曲面的統(tǒng)一數(shù)學(xué)描述方法,它可通過(guò)調(diào)整控制頂點(diǎn)和權(quán)因子,方便地改變曲面形狀,同時(shí)也可方便地轉(zhuǎn)換成對(duì)應(yīng)Bezier曲面。給定n+1個(gè)控制點(diǎn)及權(quán)因子,那么k階〔k-1〕次NURBS曲線的表達(dá)式為:其中:為非均勻有理B樣條基函數(shù),按照deBoor-Cox遞推公式,基函數(shù)滿足一下關(guān)系:其它曲線的建立本文選取四個(gè)控制頂點(diǎn)P1,,P2,,P3,,P4,,已經(jīng)四個(gè)權(quán)因子w1,w2,w4,w4,通過(guò)Matlab計(jì)算其基函數(shù),并作出曲線。控制頂點(diǎn):每個(gè)坐標(biāo)有三個(gè)值立體的;權(quán)因子:;每個(gè)坐標(biāo)有三個(gè)值立體的非均勻節(jié)點(diǎn):;由Matlab繪制曲線如下:在每個(gè)點(diǎn)上標(biāo)注其Frenet標(biāo)架如圖:在每個(gè)點(diǎn)上標(biāo)注其曲率、撓率如圖::非均勻有理B樣條曲面〔3階〕假設(shè)給定R3空間中,齊次坐標(biāo)下的個(gè)點(diǎn),那么參數(shù)曲面:稱為矩形域[0,1]x[0,1]上的mxn次有理B樣條曲面。其中稱為控制頂點(diǎn),稱為權(quán)因子。NURBS曲面的表達(dá)式為:曲面計(jì)算的根本公式曲面第一根本形式:曲面第二根本形式:高斯曲率計(jì)算公式:平均曲率計(jì)算公式:曲面主曲率計(jì)算公式:,曲面的建立選擇16個(gè)頂點(diǎn)構(gòu)造B樣條曲面,如表1所示:表116個(gè)頂點(diǎn)坐標(biāo)數(shù)據(jù)序號(hào)xyz1-24.8849.76-4.352-23.660.560.153-19.4771.915.174-11.9981.099.785-22.8950.75-3.016-21.0361.451.447-16.6572.446.348-9.4781.3510.729-20.2551.91-1.2910-17.6662.433.1811-12.9672.967.9112-6.1581.5711.9513-16.3453.371.0414-12.8163.545.5715-7.6173.4110.0416-1.4581.7213.67權(quán)因子:;計(jì)算結(jié)果如圖:圖1B樣條曲面高斯曲率K圖2B樣條曲面平均曲率H圖3E值圖4F值圖5G值圖6L值圖7L值圖8N值圖9k1值圖10k2值參考文獻(xiàn)[1]王省富.樣條函數(shù)及其應(yīng)用[M].西北工業(yè)大學(xué)出版社,1989,9,西安.[2]張化光,劉鑫蕊,孫秋野.MATLAB/SIMULINK實(shí)用教程[M].人民郵電出版社,2009,3,北京.[3]JohnH.Mathews,KurtisD.Fink.數(shù)值方法〔MATLAB版〕.電子工業(yè)出版社,2002,6,北京.附錄〔Matlab源程序〕:非均勻有理B樣條曲線〔3階〕functionNURBS3clear;clc;symsrP=[010;000.5;101;111.5];w=[2,0.5,1,3];%插入點(diǎn)權(quán)重%w=[2,2,2,2];%權(quán)重相等時(shí)u=[12456.57.589.3];%非均勻節(jié)點(diǎn)〔構(gòu)造樣條基函數(shù)〕k=3;%三階非均勻有理B樣條曲線n=size(P,1);%控制點(diǎn)數(shù)目nu=size(u,2);%非均勻節(jié)點(diǎn)數(shù)ifnu==n+k+1M=100;r1=zeros(M,3);r2=zeros(M,3);r=zeros(M,3);X=linspace(u(k+1),u(n+1),M);forl=1:M%構(gòu)造非均勻有理B樣條基函數(shù)x=X(l);N=zeros(n+k,k+1);fori=1:n+kifx>=u(i)&&x<u(i+1)N(i,1)=1;endendforj=2:k+1fori=1:n+k-j+1N(i,j)=(x-u(i))/(u(i+j-1)-u(i))*N(i,j-1)+(u(i+j)-x)/(u(i+j)-u(i+1))*N(i+1,j-1);endendform1=1:nform2=1:3r1(l,m2)=r1(l,m2)+w(m1)*N(m1,k+1)*P(m1,m2);%分子endr2(l,:)=r2(l,:)+w(m1)*N(m1,k+1);%分母endendr=r1./r2;plot3(P(:,1),P(:,2),P(:,3),'-ko',r(:,1),r(:,2),r(:,3),'-r.');holdon;gridon;axisequallegend('控制多邊形','B-樣條曲線');elsedisp('輸入錯(cuò)誤,請(qǐng)核查u的維數(shù)是否滿足n+k+1');endaxisequal%一階導(dǎo)xt1=diff(r(:,1)',1);yt1=diff(r(:,2)',1);zt1=diff(r(:,3)',1);ft1=[xt1;yt1;zt1]';%2階導(dǎo)xt2=diff(r(:,1)',2);yt2=diff(r(:,2)',2);zt2=diff(r(:,3)',2);ft2=[xt2;yt2;zt2]';%3階導(dǎo)xt3=diff(r(:,1)',3);yt3=diff(r(:,2)',3);zt3=diff(r(:,3)',3);ft3=[xt3;yt3;zt3]';%%%曲率計(jì)算k=zeros(size(ft2,1),1);fori=1:size(ft2,1)n1=ft1(i,:);n2=ft2(i,:);ka=sqrt(sum(cross(n1,n2).*cross(n1,n2)));kb=sqrt(sum(n1.*n1));k(i)=ka/kb^3;end%在點(diǎn)上表示曲率大小figure(2)plot3(P(:,1),P(:,2),P(:,3),'-ko',r(:,1),r(:,2),r(:,3),'-r.');holdon;gridon;axisequalforj=1:2:M-3quiver3(r(j,1),r(j,2),r(j,3),0,0,k(j),'b');endlegend('控制多邊形','B-樣條曲線','曲率');%%%撓率計(jì)算t=zeros(size(ft3,1),1);fori=1:size(ft3,1)nn1=ft1(i,:);nn2=ft2(i,:);nn3=ft3(i,:);ta=det([nn1;nn2;nn3]);t(i)=ta/ka^2;end%在點(diǎn)上表示撓率大小figure(3)plot3(P(:,1),P(:,2),P(:,3),'-ko',r(:,1),r(:,2),r(:,3),'-r.');holdon;gridon;axisequalforj=2:2:M-3quiver3(r(j,1),r(j,2),r(j,3),0,0,t(j),'b');endlegend('控制多邊形','B-樣條曲線','撓率');%%在點(diǎn)上表示其Frenetic標(biāo)架figure(4)plot3(P(:,1),P(:,2),P(:,3),'-ko',r(:,1),r(:,2),r(:,3),'-r.');holdon;gridon;axisequalforj=1:M-2alpha=ft1(j,:)/norm(ft1(j,:));quiver3(r(j,1),r(j,2),r(j,3),alpha(1),alpha(2),alpha(3),'b');beta=ft2(j,:)/(k(j)*norm(ft2(j,:))^2);beta=beta/norm(beta);quiver3(r(j,1),r(j,2),r(j,3),beta(1),beta(2),beta(3),'g');gama=cross(alpha,beta)/norm(cross(alpha,beta));quiver3(r(j,1),r(j,2),r(j,3),gama(1),gama(2),gama(3),'m');endlegend('控制多邊形','B-樣條曲線','alpha','beta','gama');非均勻有理B樣條曲面〔3階〕P1,,P2,,P3,,P4,,已經(jīng)四個(gè)權(quán)因子w1,w2,w4,w4,通過(guò)Matlab計(jì)算其基函數(shù),并作出曲線。Clear;clcfid=fopen('Data.dat','r');k=1;s=fscanf(fid,'%s',1);%讀字符串1維num=0;%NUM的行數(shù)Dotnum=zeros(1);%保存每個(gè)NUM的點(diǎn)的個(gè)數(shù)Dot=cell(1);%保存每個(gè)NUM的點(diǎn)的坐標(biāo)whilek==1ifstrcmp(s,'NUM')a=fscanf(fid,'%d',2);%讀整型數(shù)據(jù)2維num=num+1;k=1;elsek=0;break;endb=fscanf(fid,'%f',3*a(2));%讀浮點(diǎn)型數(shù)據(jù)3*a(2)維Dotnum(num)=a(2);b=reshape(b,3,a(2));%將b轉(zhuǎn)化為3行19列Dot{num}=b';%clearaclearbs=fscanf(fid,'%s',1);%讀字符串1維end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%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,2),Dot{i+1}(j+1,2),Dot{i+1}(j+2,2),Dot{i+1}(j+3,2);Dot{i+2}(j,2),Dot{i+2}(j+1,2),Dot{i+2}(j+2,2),Dot{i+2}(j+3,2);Dot{i+3}(j,2),Dot{i+3}(j+1,2),Dot{i+3}(j+2,2),Dot{i+3}(j+3,2);];zc=[Dot{i}(j,3),Dot{i}(j+1,3),Dot{i}(j+2,3),Dot{i}(j+3,3);Dot{i+1}(j,3),Dot{i+1}(j+1,3),Dot{i+1}(j+2,3),Dot{i+1}(j+3,3);Dot{i+2}(j,3),Dot{i+2}(j+1,3),Dot{i+2}(j+2,3),Dot{i+2}(j+3,3);Dot{i+3}(j,3),Dot{i+3}(j+1,3),Dot{i+3}(j+2,3),Dot{i+3}(j+3,3);];A=a*xc*b';%曲面上點(diǎn)的坐標(biāo)賦值B=a*yc*b';C=a*zc*b';rA=A;rB=B;rC=C;surf(A,B,C),shadinginterp;colormap(jet)%彩色顯示endendfori=1:num-3forj=1:Dotnum(num)-3xc=[Dot{i}(j,1),Dot{i}(j+1,1),Dot{i}(j+2,1),Dot{i}(j+3,1);Dot{i+1}(j,1),Dot{i+1}(j+1,1),Dot{i+1}(j+2,1),Dot{i+1}(j+3,1);Dot{i+2}(j,1),Dot{i+2}(j+1,1),Dot{i+2}(j+2,1),Dot{i+2}(j+3,1);Dot{i+3}(j,1),Dot{i+3}(j+1,1),Dot{i+3}(j+2,1),Dot{i+3}(j+3,1);];yc=[Dot{i}(j,2),Dot{i}(j+1,2),Dot{i}(j+2,2),Dot{i}(j+3,2);Dot{i+1}(j,2),Dot{i+1}(j+1,2),Dot{i+1}(j+2,2),Dot{i+1}(j+3,2);Dot{i+2}(j,2),Dot{i+2}(j+1,2),Dot{i+2}(j+2,2),Dot{i+2}(j+3,2);Dot{i+3}(j,2),Dot{i+3}(j+1,2),Dot{i+3}(j+2,2),Dot{i+3}(j+3,2);];zc=[Dot{i}(j,3),Dot{i}(j+1,3),Dot{i}(j+2,3),Dot{i}(j+3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2-K(h,k));k2(h,k)=H(h,k)-sqrt(H(h,k)^2-K(h,k));%%%%%%%%%%%%%%%%%%%%%%%%%高斯曲率bl=1000;if(H(h,k)==NaN)break;elseAD(h,k)=A+bl*1.0/H(h,k)*n(:,1);BD(h,k)=B+bl*1.0/H(h,k)*n(:,2);CD(h,k)=C+bl*1.0/H(h,k)*n(:,3);line([AAD(h,k)],[BBD(h,k)],[CCD(h,k)],'Color','b');endendendendendfigure(2);surf(rA,rB,rC),shadinginterp;colormap(jet)%彩色顯示holdon;gridon;fori=1:size(rA,1)forj=1:size(rA,2)quiver3(rA(i,j),rB(i,j),rC(i,j),0,0,E(i,j),'b');endendfigure(3);surf(rA,rB,rC),shadinginterp;colormap(jet)%彩色顯示holdon;gridon;fori=1:size(rA,1)forj=1:size(rA,2)quiver3(rA(i,j),rB(i,j),rC(i,j),0,0,F(i,j)/20,'b');endendfigure(4);surf(rA,rB,rC),shadinginterp;colormap(jet)%彩色顯示holdon;gridon;fori=1:size(rA,1)forj=1:size(rA,2)quiver3(rA(i,j),rB(i,j),rC(i,j),0,0,G(i,j)/20,'b');endendfigure(5);surf(rA,rB,rC),shadinginterp;color

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論