三維建模方法之CSG與B-Rep比較

 

轉於http://3dke.blogbus.com/logs/61375826.html

  計算機中表示三維形體的模型,按照幾何特點進行分類,大體上可以分爲三種:線框模型、表面模型和實體模型。如果按照表示物體的方法進行分類,實體模型基本上可以分爲分解表示、構造表示CSG(Constructive Solid Geometry)和邊界表示BREP(Boundary Representation)三大類。
 
  常用的分解表示法有:四叉樹、八叉樹、多叉樹、BSP樹等等。
  構造表示的主要方法:掃描表示、構造實體幾何表示、特徵和參數化表示。
  邊界表示的典型代表是翼邊結構。
 
  CSG建模法,一個物體被表示爲一系列簡單的基本物體(如立方體、圓柱體、圓錐體等)的布爾操作的結果,數據結構爲樹狀結構。樹葉爲基本體素或變換矩陣,結點爲運算,最上面的結點對應着被建模的物體;而BREP的一個物體被表示爲許多曲面(例如面片,三角形,樣條)粘合起來形成封閉的空間區域。
   
  BRep優點:
  1. 有較多的關於面、邊、點及其相互關係的信息。 
  2. 有利於生成和繪製線框圖、投影圖,有利於計算幾何特性,易於同二維繪圖軟件銜接和同曲面建模軟件相關聯。


  BRep侷限:
  由於它的核心信息是面,因而對幾何物體的整體描述能力相對較差,無法提供關於實體生成過程的信息,也無法記錄組成幾何體的基本體素的元素的原始數據,同時描述物體所需信息量較多,邊界表達法的表達形式不唯一。
 
  CSG優點:
  方法簡潔,生成速度快,處理方便,無冗餘信息,而且能夠詳細地記錄構成實體的原始特徵參數,甚至在必要時可修改體素參數或附加體素進行重新拼合。數據結構比較簡單,數據量較小,修改比較容易,而且可以方便地轉換成邊界(Brep)表示。
 
  CSG侷限:
  由於信息簡單,這種數據結構無法存貯物體最終的詳細信息,例如邊界、頂點的信息等。由於CSG表示受體素的種類和對體素操作的種類的限制,使得它表示形體的覆蓋域有較大的侷限性,而且對形體的局部操作(例如,倒角等等)不易實現,顯示CSG表示的結果形體時需要的間也比較長。

  到底使用哪種方法呢?取決於不同的視角,他們各自都有優缺點,可以從以下幾點來考慮:
  1.現實 - 模型是否需要近似實際的材質密度,厚度和體積,或者是否需要顯示真實的曲面細節
  2.精度 - 需要什麼樣的精度級別
 
  混合模式(Hybird Model)是建立在BRep與CSG的基礎上,在同一系統中,將兩者結合起來,共同表示實體的方法。以CSG法爲系統外部模型,以B-Rep法爲內部模型,CSG法適於做用戶接口,而在計算機內部轉化爲B-Rep的數據模型。相當於在CSG樹結構的結點上擴充邊界法的數據結構。混合模式是在CSG基礎上的邏輯擴展,起主導作用的是CSG結構,B-Rep的存在,減少了中間環節中的數學計算量,可以完整的表達物體的幾何、拓撲信息,便於構造產品模型。
 
  還有空間劃分表示法,利用四叉樹或八叉數的數據結構來表示2D/3D的模型。

--------------------------------

To determine if the B-rep model of the handle was actually smaller than models created using the CSG method, a sample handle was created using both of these methods. The CSG method produced a model that used 50% more disk space than the B-rep method handle. It was also more difficult to construct, and required more constraint equations and variables. Clearly, the B-rep method was indeed the best choice for this model.

Next, a similar study was conducted for the connector model. Again, the same model was created using CSG and B-rep methods. The CSG method did have to use a profile and circular sweep to construct the countersink on the bottom of the connector. For this set of models, the CSG method had a 10% smaller file size, and was easier to construct. This is most likely due to the complex profile that had to be created for the B-rep method. By constructing this part as a series of co-axial cylinders that all start at the same point, but have different heights and diameters, the process was significantly simpler than the original design. The original design for the CSG model used cylinders stacked on top of each other, and the inside part of the connector was not hollow. The decision to create a hollow center in the connector complicated the B-rep method significantly, but simplified the CSG method. Due to this change, the connector model would probably have been better created using the CSG method from this test.

The third family was simply a profile, so those parts could not be made with CSG methods. For the fourth family, the main body of the part was again constructed with B-rep and a combination of B-rep and CSG methods. Again, the method that used CSG proved to be a better choice. A CSG box primitive of the proper size was inserted. Then, a B-rep rotate face operation was performed on two of the faces. The pure B-rep method required that the cplane first be changed from the default top cplane to the right cplane. The profile had to be inserted in two parts and then unioned. The profile was extruded, and the cplane changed back to the top cplane. This required six commands, and multiple attempts before the profile could be constructed correctly. The B-rep method also resulted in a 10% larger disk file.

 

 

 

目前, 常用的特徵(Feature)的表示方法主要有以下三種:

  (1) 基於B-rep的方法: 在B-rep 方法中, 特徵被定義爲一個零件的相互聯繫的面的集合(面集)。 這些特徵也被稱爲“面特徵”。 B-rep 模型是基於圖的, 所有的幾何/拓撲信息顯式地表達在面棗邊棗頂點圖中, 因此, B-rep模型常被稱爲賦值的模型。 B-rep 表示特徵的方法受到許多研究者的喜歡, 這是因爲可以得到充足的信息以及它是基於圖的表示方法(許多特徵識別系統是基於圖表示的)。B-rep模型可以與屬性值(如, 表面粗糙度, 材料等)、尺寸和公差聯繫在一起,B-rep方法的缺點是它與特徵體素和體積特徵沒有直接的聯繫, 特徵操作(如, 刪除特徵)難於進行。


  (2) 基於CSG 的方法: 基於CSG 的特徵表達方法將特徵定義爲體積元素,體積元素通過布爾操作構造零件。 使用CSG 表示方法簡捷、有效、易於編輯和操作體素,並提供CSG和特徵體素之間有意義的聯繫, 而且二叉樹可用於特徵模型的構造。 對於特徵提取,CSG 模型的主要問題是其表示的不唯一性, 以及缺少對低層的構形元素的顯式表達。然而,給CSG 模型賦值, 推導出其相應的邊界表示, 就可以克服這些問題。


  (3) 基於混合CSG/B-rep的方法: 由於CSG 和B-rep表示方法都各有優缺點,因此,汲取二者優點的混合表示方法便產生了。Nnaji和Liu開發了一個工藝規劃系統,可以提取基於CSG 的信息(B-rep信息是由CSG 模型導出的)。重新構造CSG 樹和B-rep信息,使其成爲以一種混合形式來表示特徵的另一種CSG 樹。Roy和Liu提出一種混合CSG/B-rep方法表示特徵及尺寸和公差。特徵的層次結構提供物體組件關係的多級表示,並在每級的細節保持有邊界表示。Gossard等人提出一種在幾何造型中顯式地表示尺寸公差和幾何特徵的方法,此方法將CSG 和B-rep表示結合在一個被稱爲形體圖的圖結構中。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章