張國軍 幸 研
(東南大學(xué)機(jī)械工程學(xué)院, 南京 211189)
?
一種基于端點(diǎn)非插值性的NURBS曲面重構(gòu)方法
張國軍 幸 研
(東南大學(xué)機(jī)械工程學(xué)院, 南京 211189)
為了解決多面片拼接曲面、多修飾特征曲面連續(xù)性差且難以延展的問題,提出了基于端點(diǎn)非插值性的NURBS曲面重構(gòu)方法.首先根據(jù)位置和曲率的不同,將原始曲面離散為點(diǎn)云數(shù)據(jù),根據(jù)離散點(diǎn)計(jì)算各個(gè)采樣路徑上的節(jié)點(diǎn)矢量;然后計(jì)算出曲面重構(gòu)所需的端點(diǎn)非插值性的共同節(jié)點(diǎn)矢量及相應(yīng)的控制點(diǎn),并將共同節(jié)點(diǎn)矢量轉(zhuǎn)化成標(biāo)準(zhǔn)的端點(diǎn)插值節(jié)點(diǎn)矢量,根據(jù)最新的端點(diǎn)插值節(jié)點(diǎn)矢量在無數(shù)據(jù)點(diǎn)區(qū)間插入新的型值點(diǎn);最后將所有數(shù)據(jù)點(diǎn)重新擬合成單一曲面.重構(gòu)結(jié)果表明,通過使用該方法重構(gòu)所需的計(jì)算量降低,重構(gòu)出的曲面精度較高.在曲率變化劇烈處,既保證了與原始曲面的貼合率,又保證了截面線的曲率連續(xù)性.該方法將原始曲面重構(gòu)為單一曲面,提高了曲面重構(gòu)精度,有效地解決了造型中易出現(xiàn)的曲面退化、曲面畸變等問題.
非均勻有理B樣條;曲面離散;曲面重構(gòu);端點(diǎn)非插值性
非均勻有理B樣條(non-uniform rational B-spline,NURBS)在數(shù)學(xué)和算法上具有良好的性質(zhì),為解析曲線曲面和自由型曲線曲面的表示提供了一種統(tǒng)一的數(shù)學(xué)方法,在CAD領(lǐng)域中已成為表示曲線曲面的標(biāo)準(zhǔn)[1-2].
在工程應(yīng)用中,絕大部分模型具有復(fù)雜的曲面結(jié)構(gòu),在建模過程中用一張曲面來表達(dá)復(fù)雜的外形特征比較困難,設(shè)計(jì)者為滿足曲面之間邊界的連續(xù)性,往往采用多張曲面或者對(duì)曲面進(jìn)行橋接等操作來展示其復(fù)雜的外形特征.這樣的拼接曲面在后續(xù)的操作過程中容易出現(xiàn)曲面畸形和曲面邊界退化等問題.因此,需要對(duì)原始曲面進(jìn)行重構(gòu),構(gòu)造出單張連續(xù)的NURBS曲面.
很多學(xué)者對(duì)空間曲面的重構(gòu)進(jìn)行了大量的研究.Hu等[3]將NURBS的端點(diǎn)非插值性應(yīng)用于曲線和曲面的外插延伸;Chen等[4]應(yīng)用端點(diǎn)非插值性實(shí)現(xiàn)三次B-spline曲線的逼近.這些算法都是在節(jié)點(diǎn)矢量端點(diǎn)插值的基礎(chǔ)上向前(后)插值構(gòu)造出新的節(jié)點(diǎn)矢量,新的節(jié)點(diǎn)矢量都是基于單條曲線的非端點(diǎn)插值矢量且突破了原有曲線邊界,并沒有考慮與其他曲線節(jié)點(diǎn)矢量之間的關(guān)系,即在NURBS曲面重構(gòu)中,各截面線不僅有輪廓界限,而且要具備共同節(jié)點(diǎn)矢量.由于大多數(shù)原始曲面的邊界并不規(guī)則,導(dǎo)致重構(gòu)過程中所需的截面線的次數(shù)p不完全相同,節(jié)點(diǎn)矢量也不完全相同,因此需要對(duì)這些截面線進(jìn)行處理,以獲取共同節(jié)點(diǎn)矢量.
本文應(yīng)用NURBS節(jié)點(diǎn)矢量端點(diǎn)非插值特性,提出了一種更快、更高效的共同節(jié)點(diǎn)矢量確定方法,在充分考慮到各截面線的節(jié)點(diǎn)矢量信息的同時(shí),對(duì)共同節(jié)點(diǎn)向量進(jìn)行插值性轉(zhuǎn)換[5],實(shí)現(xiàn)原始曲面的NURBS重構(gòu).
定義一條p次NURBS曲線為
(1)
式中,Pi為控制點(diǎn),可形成控制多邊形;ωi為權(quán)因子;Ni,p(u)為定義在非周期節(jié)點(diǎn)矢量u上的p次B樣條基函數(shù),可以根據(jù)德布爾算法[1](de Boer algorithm)來計(jì)算[1,6],即
(2)
曲面重構(gòu)是基于B樣條插值曲線與蒙皮曲面的擬合,利用一張光滑的曲面擬合原始拼接曲面,使其具有良好的幾何建模性能.本文提出的基于端點(diǎn)非插值性的重構(gòu)方法流程如圖1所示.
2.1 節(jié)點(diǎn)矢量的端點(diǎn)非插值性與端點(diǎn)插值性
節(jié)點(diǎn)矢量分為端點(diǎn)插值和端點(diǎn)非插值[7].p次m+1個(gè)節(jié)點(diǎn)向量通常表示為
(3)
圖1 曲面重構(gòu)流程
對(duì)于端點(diǎn)插值節(jié)點(diǎn)矢量,第一個(gè)和最后一個(gè)節(jié)點(diǎn)重復(fù)度等于曲線的階數(shù);而非端點(diǎn)插值節(jié)點(diǎn)矢量,第一個(gè)和最后一個(gè)節(jié)點(diǎn)重復(fù)度不等于曲線的階數(shù).
2.2 基于端點(diǎn)非插值性的共同節(jié)點(diǎn)向量的確定
曲面一般都具有復(fù)雜的外形,往往是由多張曲面拼接而成,而且面片之間進(jìn)行了復(fù)雜的裁剪、平移等操作.在實(shí)際操作過程中,由于各個(gè)面片輪廓復(fù)雜且階數(shù)不同[8],當(dāng)在給定邊界上沿不同路徑獲取曲面離散點(diǎn)時(shí),各個(gè)路徑可能會(huì)通過一個(gè)或者多個(gè)面片;另外由于曲面邊界的不規(guī)則,不同路徑上離散數(shù)據(jù)點(diǎn)的數(shù)量也會(huì)有差別, 如圖2(a)所示.當(dāng)2條采樣路徑距離很小時(shí)(即通過相同的面片),采樣路徑曲率大小不同,使采樣點(diǎn)數(shù)量出現(xiàn)差異,如圖2(b)、(c)所示.
(a) 定義不同的采樣路徑
(b) 路徑3曲率分析 (c) 路徑4曲率分析
(4)
(5)式中,0≤t (6) (7) 式中,f≠p;T(ui)為端點(diǎn)非插值性的節(jié)點(diǎn)向量,應(yīng)用Piegl等[1]提出的算法求解新的控制點(diǎn)Qi,i=0,1,…,H. (8) 式中,f+1+s=p+1,f+1+m=p+1;s為左側(cè)節(jié)點(diǎn)矢量插入數(shù)量;m為右節(jié)點(diǎn)插入的數(shù)量.節(jié)點(diǎn)向量標(biāo)準(zhǔn)化為 (9) 即得到共同節(jié)點(diǎn)向量U(ui),實(shí)現(xiàn)截面線相容[10],如圖3所示.根據(jù)共同節(jié)點(diǎn)矢量,將型值點(diǎn)(離散點(diǎn))細(xì)化,圖4中橢圓形的點(diǎn)即為新增的型值點(diǎn). (a) 初始截面線 (b) 相容后的截面線 圖4 型值點(diǎn)加密 在熱成形模具型面的設(shè)計(jì)過程中,首先要對(duì)熱成形零件曲面進(jìn)行修剪、外插延伸等操作,然后再進(jìn)行對(duì)應(yīng)上下模體的設(shè)計(jì).由于大多數(shù)多面片拼接的零件曲率變化較大且曲率不連續(xù),設(shè)計(jì)人員無法直接對(duì)熱成形零件曲面進(jìn)行外插延伸操作,需要對(duì)零件曲面進(jìn)行反復(fù)的修補(bǔ)達(dá)到曲面延伸的基本要求,其過程復(fù)雜,操作繁瑣,且延伸后的曲面質(zhì)量無法保證,影響了熱成形模具的設(shè)計(jì)效率[11]. 本文將基于非端點(diǎn)插值NURBS曲面重構(gòu)相關(guān)算法集成到熱成形零件曲面延伸重構(gòu)操作中,獲取了連續(xù)性較好的單張曲面,減少了熱成形零件表面延展過程中出現(xiàn)的曲面扭曲和畸形等問題,提高了設(shè)計(jì)效率.輸入型值點(diǎn)矩陣,可通過集成后的算法計(jì)算共同節(jié)點(diǎn)矢量和控制點(diǎn)陣,實(shí)現(xiàn)原始拼接曲面的重構(gòu).曲面的重構(gòu)過程如圖5所示. (a) 原始曲面 (b) 初始型值點(diǎn) (c) 型值點(diǎn)加密 (d) 重構(gòu)曲面 對(duì)重構(gòu)好的曲面進(jìn)行誤差分析.由圖6所示的重構(gòu)曲面誤差分析圖及表1重構(gòu)曲面與原始曲面誤差統(tǒng)計(jì)表可知, 76.96%的重構(gòu)曲面與原始曲面間的誤差小于0.027 mm,且曲面最大誤差僅為0.104 mm,占重構(gòu)后曲面比例低于2.53%,因此曲面重構(gòu)精度較高. 圖6 重構(gòu)曲面誤差分析 誤差區(qū)間/mm占重構(gòu)曲面比例/%0~0.02776.960.027~0.05314.600.053~0.0785.890.078~0.1042.53 本文針對(duì)拼接曲面提出了基于非端點(diǎn)插值理論的NUEBS曲面重構(gòu)方法,詳細(xì)闡述了曲面重構(gòu)過程中關(guān)鍵參數(shù)的確定.通過易于構(gòu)造的非端點(diǎn)插值的節(jié)點(diǎn)矢量,經(jīng)過節(jié)點(diǎn)矢量的升(降)階和節(jié)點(diǎn)插入(去除)算法轉(zhuǎn)化為標(biāo)準(zhǔn)形式的端點(diǎn)插值的共同節(jié)點(diǎn)矢量,將確定后的共同節(jié)點(diǎn)矢量用于重新細(xì)化型值點(diǎn),為控制點(diǎn)求解提供點(diǎn)云數(shù)據(jù),實(shí)現(xiàn)了參數(shù)化NURBS曲面的重構(gòu).對(duì)重構(gòu)誤差進(jìn)行了統(tǒng)計(jì),結(jié)果表明,最大誤差僅為0.104 mm,占重構(gòu)后曲面的比例低于2.53%.因此基于端點(diǎn)非插值性的曲面重構(gòu)方法具有較高的重構(gòu)精度. References) [1]Piegl Les, Tiller Wayne.TheNURBSbook[M]. New York, USA:Springer,1995:60-200. [2]Boehm W. Inserting new knots into B-spline curves [J].Computer-AidedDesign, 1980, 12(4): 199-201. [3]Hu S M, Tai C L, Zhang S H. An extension algorithm for B-splines by curve unclamping [J].Computer-AidedDesign, 2002, 34(5):415-419. [4]Chen X D, Ma W Y, Paul J C. Cubic B-spline curve approximation by curve unclamping [J].Computer-AidedDesign, 2010, 42(6):523-534. [5]Zhiming X, Jincheng C, Zhengjin F. Performance evaluation of a realtime interpolation algorithm for NURBS curves [J].IntJAdvManufactTechnol, 2002, 20:270-276. [6]Cheng F B, Liu Z Y, Duan G F,et al. NURBS surface deformation design for complex products by transplanting the surface feature[J].EngineeringwithComputers, 2014, 30(4):599-608. [7]Tsai Mengshiun, Nien Haowei, Yau Hongtzong. Development of an integrated look-ahead dynamics-based NURBS interpolator for high precision machinery [J].Computer-AidedDesign, 2008, 40(5): 554-566. [8]Shi Xiquan, Wang Tianjun,Wu Peiru, et al. Reconstruction of convergent G1 smooth B-spline surfaces [J].ComputerAidedGeometricDesign, 2004, 21(9): 893-913.[9]Jiang Q Q, Wu Z K, Zhang T, et al. G(2)-continuity extension algorithm of ball B-spline curves [J].IeiceTransactionsonInformationandSystems, 2014, 97(8):2030-2037.[10]Chen H, Bishop J. Delaunay triangulation for curved surface [C]//Proceedingsofthe6thInternationalMeshingRoundtable. Park City, USA, 1997:115-127.[11]Shetty S, White P R. Curvature-continuous extensions for rational B-spline curves and surfaces [J].Computer-AidedDesign, 1991, 23(7):484-491. A reconstruction method for NURBS surface by curve unclamping Zhang Guojun Xing Yan (School of Mechanical Engineering,Southeast University, Nanjing 21189, China) To solve the poor continuity and extension of surface with multipatch splicing and dress up features, a non-uniform rational B-spline (NURBS) surface reconstruction method based on the unclamping was proposed. First, the original surface was discretized into point-cloud according to the different locations and curvatures, the knot vectors of each sampling path were calculated based on discreted points. Then, the unclamping common knot vector and the control net required for surface-reconstruction were calculated, and the unclamping common vector needed to be changed into the clamping common vector. Based on the latest clamping vector, new data points were inserted into the rectangle without data. Finally, all data points were fitted to a single surface. The reconstruction results show that the amount of calculation is reduced and the reconstructed surface has high accuracy. It can guarantee the fitting ratio and the continuity of curvature where the curvature has sharp change. During modeling, the proposed method reconstructs the original surface to a single surface, improves the precision of the surface reconstruction and solves problems, such as surface degradation and surface distortion. non-uniform rational B-spline; surface discretization; surface reconstruction; curve unclamping 10.3969/j.issn.1001-0505.2016.06.009 2016-02-16. 作者簡介: 張國軍(1989—),男,博士生;幸研(聯(lián)系人),男,博士,教授,博士生導(dǎo)師,xingyan@seu.edu.cn. “十二五”某部先進(jìn)制造技術(shù)預(yù)先研究資助項(xiàng)目(51318010102)、江蘇省前瞻性聯(lián)合研究資助項(xiàng)目(BY2015070-06). 張國軍,幸研.一種基于端點(diǎn)非插值性的NURBS曲面重構(gòu)方法[J].東南大學(xué)學(xué)報(bào)(自然科學(xué)版),2016,46(6):1161-1164. 10.3969/j.issn.1001-0505.2016.06.009. TP39 A 1001-0505(2016)06-1161-043 曲面重構(gòu)方法應(yīng)用
4 曲面重構(gòu)誤差分析
5 結(jié)語